[haiku-bugs] Re: [Haiku] #13996: missing mkstemps function in stdlib.h

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 13 Oct 2020 16:27:27 -0000

#13996: missing mkstemps function in stdlib.h
--------------------------+----------------------------
  Reporter:  kallisti5    |      Owner:  kallisti5
      Type:  enhancement  |     Status:  assigned
  Priority:  normal       |  Milestone:  Unscheduled
 Component:  System       |    Version:  R1/Development
Resolution:               |   Keywords:
Blocked By:               |   Blocking:
  Platform:  All          |
--------------------------+----------------------------
Comment (by ahwayakchih):

 Replying to [comment:20 korli]:

Replying to [comment:19 ahwayakchih]:
Library for a next JPEG-XL format started to use `mkstemps` in their
 benchmark code (https://gitlab.com/wg1/jpeg-
 
xl/-/blob/c8ce59f8ef6393ba3018917791d04662cbf1172a/tools/benchmark/benchmark_utils.cc#L41).
 While benchmarks are not needed to use library, they are compiled by
 default and cause build to fail.

mkstemps is available if
{{{

#if defined(_BSD_SOURCE) \
      || (!defined(__STRICT_ANSI__) && !defined(_POSIX_C_SOURCE))
}}}

 Yes, it works, but only after i passed additional `-D_BSD_SOURCE` through
 CMAKE_FLAGS.

 I guess that's usable enough :), but maybe it would be good to add comment
 in bsd/stdlib.h to pass such define (so, after i search through headers,
 and find it there, i know what to add in CLI)?

 Best would be to make GCC error hint about such possibility, but that
 would probably require some very specific list of cases, which would add a
 lot of work.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/13996#comment:21>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: