mingw-w64/mingw-w64-headers/crt
Martin Storsjö 940e8faa94 headers: Make getopt.h react to _BSD_SOURCE after being included once first
getopt.h is transitively included by unistd.h, which means that
users who include unistd.h (also potentially unintentionally as
a transitive dependency) won't be able to get "optreset" declared,
if they do e.g. this:

    #include <unistd.h>
    #define _BSD_SOURCE
    #include <getopt.h>

This recently broke building LLDB with latest nightly libc++ headers,
as libc++ headers would end up including unistd.h, while LLDB
later would define _BSD_SOURCE right before including getopt.h.

For definitions like _BSD_SOURCE, the most failsafe solution
generally is to define them before including any header, to avoid
this kind of issue. However, allowing getopt.h to react to
being reincluded with _BSD_SOURCE defined, is quite straightforward.

This allows fixing a recent LLDB build break reported at
https://github.com/llvm/llvm-project/issues/76050.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-20 15:38:36 +02:00
..
sdks headers: Get rid of _mingw_directx.h. 2020-01-20 15:41:40 +01:00
sec_api headers: Add missing crt stdio functions 2023-09-07 23:00:01 +08:00
sys headers/crt: Add timespec_get in time.h 2021-12-21 21:21:52 +02:00
_bsd_types.h Fix typo ... 2012-07-30 15:15:58 +00:00
_cygwin.h Fix Cygwin builds 2013-07-23 12:33:54 +00:00
_mingw_mac.h mingw-w64-headers: bump _mingw_mac.h to 12.0.0 2023-04-28 11:23:22 +00:00
_mingw_off_t.h removed svn:executable property 2011-08-09 13:29:32 +00:00
_mingw_secapi.h Remove support for --disable-secure-api. 2019-03-01 12:36:44 +01:00
_mingw_stat64.h headers: Replace checks for __MSVCRT_VERSION__ against 0x1400 with _UCRT 2019-05-06 15:15:41 +03:00
_mingw_stdarg.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
_mingw_unicode.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
_mingw.h.in headers: Fix noreturn compile warning for __fastfail() 2022-12-19 22:14:15 +08:00
_timeval.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
assert.h headers: Add noreturn attributes to the _assert/_wassert functions 2023-04-05 14:25:29 +03:00
ChangeLog 2014-03-03 Ray Donnelly mingw.android@gmail.com 2014-03-03 19:55:42 +00:00
ChangeLog-2009 formatting/whitespace fix for ChangeLog 2010-05-02 15:01:14 +00:00
ChangeLog.2010 Fix Changelog format. 2011-01-04 09:35:43 +00:00
ChangeLog.2011 Rotate ChangeLog 2012-01-06 14:52:24 +00:00
ChangeLog.2012 Bump 2012 2013-01-11 16:06:50 +00:00
ChangeLog.2013 Rotate 2013 log 2014-01-25 02:21:20 +00:00
complex.h complex: Add clog10*. 2016-03-25 18:53:37 +08:00
conio.h crt/{stdio,conio,wchar}: Move attributes before function declarators 2021-04-22 11:14:26 +08:00
corecrt_startup.h crt: Fix the parameter type for UCRT _crt_atexit 2021-05-03 11:05:55 +03:00
corecrt_stdio_config.h headers: Add corecrt_stdio_config.h header. 2020-03-10 11:33:26 +01:00
corecrt_wstdlib.h headers: Add missing extern "C" from 228a789d38 2019-03-02 08:38:54 +02:00
corecrt.h headers: Move _UCRT into '_mingw.h' from 'corecrt.h' 2021-07-25 11:36:02 +08:00
crtdbg.h headers: crt: Add declarations for _aligned_msize 2023-04-02 21:12:13 +08:00
crtdefs.h corecrt.h: Add new file and move declaration from crtdefs.h there. 2019-03-01 12:36:49 +01:00
ctype.h crt: make iswblank always available in C++ 2021-06-06 12:04:08 +08:00
dir.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
direct.h include/crt: Ensure declarations of _*_nolock match MSVCRT version 2021-02-06 10:11:49 +08:00
dirent.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
dos.h headers: crt: disable some drive API's in winstore builds 2020-04-21 21:43:02 +08:00
dvec.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
eh.h headers: Include typeinfo in eh.h for std::type_info 2022-12-13 11:58:44 +08:00
errno.h some errnos added(PR 564) 2016-10-09 02:50:06 +03:00
excpt.h headers: Fix macros in except.h 2023-01-07 20:23:09 +08:00
fcntl.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
fenv.h fenv: Merge the arm and aarch64 sections of fenv.h 2017-08-27 14:01:31 +03:00
float.h headers: Fix _SECIMP comment 2022-09-20 11:18:06 +03:00
fpieee.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
ftw.h Add new header and implementation for File Tree Walking API. 2014-08-20 15:51:39 +02:00
fvec.h headers: Fix include order of fvec.h/ivec.h/dvec.h referring to each other 2020-05-07 20:11:26 +03:00
getopt.h headers: Make getopt.h react to _BSD_SOURCE after being included once first 2023-12-20 15:38:36 +02:00
ieeefp.h Do not include non-exist header file 'ansidecl.h'. 2015-01-03 15:56:30 +08:00
intrin.h headers: Make __MACHINEI a no-op on non-x86 architectures 2023-08-07 15:55:13 +03:00
inttypes.h inttypes: Fix check for __USE_MINGW_ANSI_STDIO 2023-03-02 14:52:47 +08:00
io.h headers: _FORTIFY_SOURCE: Enhance missing open() argument warning 2023-02-04 21:18:04 +08:00
ivec.h headers: Fix include order of fvec.h/ivec.h/dvec.h referring to each other 2020-05-07 20:11:26 +03:00
libgen.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
limits.h Fix CHAR_MIN and CHAR_MAX for C11 when -funsigned-char is used 2015-09-01 21:20:03 +08:00
locale.h headers/locale: Make result of localeconv() accord to GCC's -funsigned-char option 2021-06-14 19:27:13 +08:00
malloc.h headers: crt: Add declarations for _aligned_msize 2023-04-02 21:12:13 +08:00
math.h headers: Don't do inline redirects from <func>f() to <func>() on UCRT 2023-10-27 18:25:19 +03:00
mbctype.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
mbstring.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
mem.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
memory.h headers: Fix _SECIMP comment 2022-09-20 11:18:06 +03:00
new.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
process.h include/process: fix bare DllMain/_CRT_INIT signature 2023-09-29 20:46:53 +08:00
profile.h Move profile-header from platform-headers to C-runtime-headers. 2014-05-22 12:47:37 +02:00
pthread_signal.h spelling 2015-08-16 15:20:15 +08:00
pthread_time.h spelling 2015-08-16 15:20:15 +08:00
pthread_unistd.h spelling 2015-08-16 15:20:15 +08:00
search.h crt: Implement tdestroy 2022-10-23 21:58:24 +08:00
sehmap.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
setjmp.h headers: Remove the unused ifdefs for USE_NO_MINGW_SETJMP_TWO_ARGS 2023-03-09 14:05:35 +02:00
setjmpex.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
share.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
signal.h New dummy signal.h entry for pthread 2013-09-07 05:29:31 +00:00
stdarg.h 2010-07-22 Ozkan Sezer <sezeroz@gmail.com> 2010-07-22 20:30:46 +00:00
stddef.h stddef.h: Avoid max_align_t declaration conflict with clang stddef.h. 2018-07-13 00:37:16 +02:00
stdexcpt.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
stdint.h Moved srtuct declarations from _mingw.h to crtdefs.h 2012-07-04 13:06:41 +00:00
stdio.h crt: define L_tmpnam correctly for UCRT 2023-06-27 10:41:02 +08:00
stdlib.h headers: crt: Add declarations for _aligned_msize 2023-04-02 21:12:13 +08:00
string.h headers: Fix the signature of wcstok() for UCRT in string.h 2023-02-20 00:16:24 +02:00
strings.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
swprintf.inl headers: Stop using the register storage class for local variables in inline functions 2018-03-24 13:23:13 +02:00
syslimits.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
tchar.h crt/stdlib: Add missing _wcstof_l function and redirections 2022-11-03 14:34:43 +08:00
time.h headers: Add C++ overloads for _strdate_s and _strtime_s in time.h. 2023-05-19 10:08:18 +08:00
uchar.h headers: Hide UTF-16 and UTF-32 functions from libmsvcrt 2023-04-27 23:12:07 +08:00
unistd.h winstorecompat: provide getpid 2020-05-15 00:10:53 +03:00
utime.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
vadefs.h crtdefs.h: Moved remaining typedefs from _mingw.h to crtdefs.h. 2014-03-23 10:41:51 +00:00
varargs.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
wchar.h headers: Add missing crt stdio functions 2023-09-07 23:00:01 +08:00
wctype.h include/crt: Ensure declarations of *wcsym* match MSVCRT version 2021-02-06 10:11:48 +08:00
xlocinfo.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
xmath.h _SECIMP patch 2 of 3: These data imports are *always* resolved from DLLs. 2016-08-26 17:24:11 -07:00
ymath.h Replace 'w64 mingw-runtime' by 'mingw-w64 runtime' 2012-06-28 15:40:59 +00:00
yvals.h ucrt: Use multibyte functions from ucrt instead of libmingwex 2019-10-29 16:09:32 +02:00