OSDN Git Service

Incorporate user-customized <features.h> configuration.
[mingw/mingw-org-wsl.git] / mingwrt / include / _mingw.h.in
1 /*
2  * _mingw.h
3  *
4  * MinGW specific macros included by ALL mingwrt include files; (this file
5  * is part of the MinGW32 runtime library package).
6  *
7  * $Id$
8  *
9  * Written by Mumit Khan  <khan@xraylith.wisc.edu>
10  * Copyright (C) 1999, 2001-2011, 2014-2019, MinGW.org Project
11  *
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice (including the next
21  * paragraph) shall be included in all copies or substantial portions of the
22  * Software.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30  * DEALINGS IN THE SOFTWARE.
31  *
32  */
33 #ifndef __MINGW_H
34 #define __MINGW_H
35
36 /* In previous versions, __MINGW32_VERSION was expressed as a dotted
37  * numeric pair, representing major.minor; unfortunately, this doesn't
38  * adapt well to the inclusion of a patch-level component, since the
39  * major.minor.patch dotted triplet representation is not valid as a
40  * numeric entity.  Thus, for this version, we adopt a representation
41  * which encodes the version as a long integer value, expressing:
42  *
43  *   __MINGW32_VERSION = 1,000,000 * major + 1,000 * minor + patch
44  *
45  * DO NOT EDIT these package version assignments manually; they are
46  * derived from the package version specification within configure.ac,
47  * whence they are propagated automatically, at package build time.
48  */
49 #define __MINGW32_VERSION           %PACKAGE_VERSION_LONG%L
50 #define __MINGW32_MAJOR_VERSION     %PACKAGE_VERSION_MAJOR%
51 #define __MINGW32_MINOR_VERSION     %PACKAGE_VERSION_MINOR%
52 #define __MINGW32_PATCHLEVEL        %PACKAGE_VERSION_PATCH%
53
54 #if __GNUC__ >= 3 && ! defined __PCC__
55 #pragma GCC system_header
56 #endif
57
58 #ifndef _MSVCRTVER_H
59 /* Legacy versions of mingwrt use the macro __MSVCRT_VERSION__ to
60  * enable evolving features of different MSVCRT.DLL versions.  This
61  * usage is no longer recommended, but the __MSVCRT_VERSION__ macro
62  * remains useful when a non-freely distributable MSVCRxx.DLL is to
63  * be substituted for MSVCRT.DLL; for such usage, the substitute
64  * MSVCRxx.DLL may be identified as specified in...
65  */
66 # include <msvcrtver.h>
67 #endif
68
69 /* A better inference than __MSVCRT_VERSION__, of the capabilities
70  * supported by the operating system default MSVCRT.DLL, is provided
71  * by the Windows API version identification macros.
72  */
73 #include <w32api.h>
74
75 /* The following are defined by the user (or by the compiler), to specify how
76  * identifiers are imported from a DLL.  All headers should include this first,
77  * and then use __DECLSPEC_SUPPORTED to choose between the old ``__imp__name''
78  * style or the __MINGW_IMPORT style for declarations.
79  *
80  * __DECLSPEC_SUPPORTED            Defined if dllimport attribute is supported.
81  * __MINGW_IMPORT                  The attribute definition to specify imported
82  *                                 variables/functions.
83  * _CRTIMP                         As above.  For MS compatibility.
84  *
85  * Macros to enable MinGW features which deviate from standard MSVC
86  * compatible behaviour; these may be specified directly in user code,
87  * activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such),
88  * or by inclusion in __MINGW_FEATURES__:
89  *
90  * __USE_MINGW_ANSI_STDIO          Select a more ANSI C99 compatible
91  *                                 implementation of printf() and friends;
92  *                                 (users should not set this directly).
93  *
94  * Other macros:
95  *
96  * __int64                         define to be long long.  Using a typedef
97  *                                 doesn't work for "unsigned __int64"
98  *
99  *
100  * Manifest definitions for flags to control globbing of the command line
101  * during application start up, (before main() is called).  The first pair,
102  * when assigned as bit flags within _CRT_glob, select the globbing algorithm
103  * to be used; (the MINGW algorithm overrides MSCVRT, if both are specified).
104  * Prior to mingwrt-3.21, only the MSVCRT option was supported; this choice
105  * may produce different results, depending on which particular version of
106  * MSVCRT.DLL is in use; (in recent versions, it seems to have become
107  * definitively broken, when globbing within double quotes).
108  */
109 #define __CRT_GLOB_USE_MSVCRT__         0x0001
110
111 /* From mingwrt-3.21 onward, this should be the preferred choice; it will
112  * produce consistent results, regardless of the MSVCRT.DLL version in use.
113  */
114 #define __CRT_GLOB_USE_MINGW__          0x0002
115
116 /* When the __CRT_GLOB_USE_MINGW__ flag is set, within _CRT_glob, the
117  * following additional options are also available; they are not enabled
118  * by default, but the user may elect to enable any combination of them,
119  * by setting _CRT_glob to the boolean sum (i.e. logical OR combination)
120  * of __CRT_GLOB_USE_MINGW__ and the desired options.
121  *
122  *    __CRT_GLOB_USE_SINGLE_QUOTE__     allows use of single (apostrophe)
123  *                                      quoting characters, analogously to
124  *                                      POSIX usage, as an alternative to
125  *                                      double quotes, for collection of
126  *                                      arguments separated by white space
127  *                                      into a single logical argument.
128  *
129  *    __CRT_GLOB_BRACKET_GROUPS__       enable interpretation of bracketed
130  *                                      character groups as POSIX compatible
131  *                                      globbing patterns, matching any one
132  *                                      character which is either included
133  *                                      in, or excluded from the group.
134  *
135  * The following options, which may also be specified within _CRT_glob,
136  * are specified in terms of their glob() flags, as defined in <glob.h>
137  *
138  *    GLOB_CASEMATCH                    enable case sensitive matching for
139  *                                      globbing patterns; this is default
140  *                                      behaviour for POSIX, but because of
141  *                                      the case insensitive nature of the
142  *                                      MS-Windows file system, it is more
143  *                                      appropriate to use case insensitive
144  *                                      globbing as the MinGW default.
145  *
146  *    GLOB_BRACE                        enable expansion of GNU style brace
147  *                                      delimited expression groups within
148  *                                      the globbing pattern.
149  *
150  */
151 #define __CRT_GLOB_USE_SINGLE_QUOTE__   0x0010
152 #define __CRT_GLOB_BRACKET_GROUPS__     0x0020
153
154 /* The MinGW globbing algorithm uses the ASCII DEL control code as a marker
155  * for globbing characters which were embedded within quoted arguments; (the
156  * quotes are stripped away BEFORE the argument is globbed; the globbing code
157  * treats the marked character as immutable, and strips out the DEL markers,
158  * before storing the resultant argument).  The DEL code is mapped to this
159  * function here; DO NOT change it, without rebuilding the runtime.
160  */
161 #define __CRT_GLOB_ESCAPE_CHAR__        (char)(127)
162
163
164 /* Load any user-customized features configuration...
165  */
166 #ifdef _MINGW_FEATURES_HEADER
167 /* ...from a user-specified, or project-specified alternative file...
168  */
169 #include _MINGW_FEATURES_HEADER
170 #else
171 /* ...or fall back to the default configuration file, (which may,
172  * or may not have been customized).
173  */
174 #include <features.h>
175 #endif
176
177 #ifndef __MINGW_FEATURES__
178 /* Regardless of how the preceding features configuration header was
179  * identified, we normally expect that will have defined this, but we
180  * supply this fall-back, just in case it is needed.
181  */
182 #define __MINGW_FEATURES__              0ULL
183 #endif
184
185 /* Define macros to facilitate the user-specified configuration.
186  */
187 #define __MINGW_FEATURE_ENABLE__(__FEATURE__) | (__FEATURE__)
188 #define __MINGW_FEATURE_IGNORE__(__FEATURE__)
189
190 #define __MINGW_FEATURES_BEGIN__        0x0000000000000000ULL
191 #define __MINGW_FEATURES_UNSET__        0x0000000000000000ULL
192 #define __MINGW_FEATURES_END__
193
194 /* Manifest definitions identifying the flag bits, controlling activation
195  * of MinGW features, as specified by the user in __MINGW_FEATURES__.
196  */
197 #define __MINGW_ANSI_STDIO__            0x0000000000000001ULL
198 /*
199  * The following three are not yet formally supported; they are
200  * included here, to document anticipated future usage.
201  */
202 #define __MINGW_LC_EXTENSIONS__         0x0000000000000050ULL
203 #define __MINGW_LC_MESSAGES__           0x0000000000000010ULL
204 #define __MINGW_LC_ENVVARS__            0x0000000000000040ULL
205
206
207 /* Try to avoid problems with outdated checks for GCC __attribute__ support.
208  */
209 #undef __attribute__
210
211 #if defined (__PCC__)
212 #  undef __DECLSPEC_SUPPORTED
213 # ifndef __MINGW_IMPORT
214 #  define __MINGW_IMPORT extern
215 # endif
216 # ifndef _CRTIMP
217 #  define _CRTIMP
218 # endif
219 # ifndef __cdecl
220 #  define __cdecl  _Pragma("cdecl")
221 # endif
222 # ifndef __stdcall
223 #  define __stdcall _Pragma("stdcall")
224 # endif
225 # ifndef __int64
226 #  define __int64 long long
227 # endif
228 # ifndef __int32
229 #  define __int32 long
230 # endif
231 # ifndef __int16
232 #  define __int16 short
233 # endif
234 # ifndef __int8
235 #  define __int8 char
236 # endif
237 # ifndef __small
238 #  define __small char
239 # endif
240 # ifndef __hyper
241 #  define __hyper long long
242 # endif
243 # ifndef __volatile__
244 #  define __volatile__ volatile
245 # endif
246 # ifndef __restrict__
247 #  define __restrict__ restrict
248 # endif
249 # define NONAMELESSUNION
250 #elif defined(__GNUC__)
251 # ifdef __declspec
252 #  ifndef __MINGW_IMPORT
253    /* Note the extern. This is needed to work around GCC's
254       limitations in handling dllimport attribute.  */
255 #   define __MINGW_IMPORT  extern __attribute__((__dllimport__))
256 #  endif
257 #  ifndef _CRTIMP
258 #   ifdef __USE_CRTIMP
259 #    define _CRTIMP  __attribute__((dllimport))
260 #   else
261 #    define _CRTIMP
262 #   endif
263 #  endif
264 #  define __DECLSPEC_SUPPORTED
265 # else /* __declspec */
266 #  undef __DECLSPEC_SUPPORTED
267 #  undef __MINGW_IMPORT
268 #  ifndef _CRTIMP
269 #   define _CRTIMP
270 #  endif
271 # endif /* __declspec */
272 /*
273  * The next two defines can cause problems if user code adds the
274  * __cdecl attribute like so:
275  * void __attribute__ ((__cdecl)) foo(void);
276  */
277 # ifndef __cdecl
278 #  define __cdecl  __attribute__((__cdecl__))
279 # endif
280 # ifndef __stdcall
281 #  define __stdcall __attribute__((__stdcall__))
282 # endif
283 # ifndef __int64
284 #  define __int64 long long
285 # endif
286 # ifndef __int32
287 #  define __int32 long
288 # endif
289 # ifndef __int16
290 #  define __int16 short
291 # endif
292 # ifndef __int8
293 #  define __int8 char
294 # endif
295 # ifndef __small
296 #  define __small char
297 # endif
298 # ifndef __hyper
299 #  define __hyper long long
300 # endif
301 #else /* ! __GNUC__ && ! __PCC__ */
302 # ifndef __MINGW_IMPORT
303 #  define __MINGW_IMPORT  __declspec(dllimport)
304 # endif
305 # ifndef _CRTIMP
306 #  define _CRTIMP  __declspec(dllimport)
307 # endif
308 # define __DECLSPEC_SUPPORTED
309 # define __attribute__(x) /* nothing */
310 #endif
311
312 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
313 #define __MINGW_GNUC_PREREQ(major, minor) \
314   (__GNUC__ > (major) \
315    || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
316 #else
317 #define __MINGW_GNUC_PREREQ(major, minor)  0
318 #endif
319
320 #ifdef __cplusplus
321 # define __CRT_INLINE    inline
322 #else
323 # if __GNUC_STDC_INLINE__
324 #  define __CRT_INLINE   extern inline __attribute__((__gnu_inline__))
325 # else
326 #  define __CRT_INLINE   extern __inline__
327 # endif
328 #endif
329
330 # ifdef __GNUC__
331   /* A special form of __CRT_INLINE is provided; it will ALWAYS request
332    * inlining when possible.  Originally specified as _CRTALIAS, this is
333    * now deprecated in favour of __CRT_ALIAS, for syntactic consistency
334    * with __CRT_INLINE itself.
335    */
336 #  define  _CRTALIAS   __CRT_INLINE __attribute__((__always_inline__))
337 #  define __CRT_ALIAS  __CRT_INLINE __attribute__((__always_inline__))
338 # else
339 #  define  _CRTALIAS   __CRT_INLINE     /* deprecated form */
340 #  define __CRT_ALIAS  __CRT_INLINE     /* preferred form */
341 # endif
342 /*
343  * Each function which is implemented as a __CRT_ALIAS should also be
344  * accompanied by an externally visible interface.  The following pair
345  * of macros provide a mechanism for implementing this, either as a stub
346  * redirecting to an alternative external function, or by compilation of
347  * the normally inlined code into free standing object code; each macro
348  * provides a way for us to offer arbitrary hints for use by the build
349  * system, while remaining transparent to the compiler.
350  */
351 #define __JMPSTUB__(__BUILD_HINT__)
352 #define __LIBIMPL__(__BUILD_HINT__)
353
354 #ifdef __cplusplus
355 # define __UNUSED_PARAM(x)
356 #else
357 # ifdef __GNUC__
358 #  define __UNUSED_PARAM(x) x __attribute__((__unused__))
359 # else
360 #  define __UNUSED_PARAM(x) x
361 # endif
362 #endif
363
364 #ifdef __GNUC__
365 #define __MINGW_ATTRIB_NORETURN __attribute__((__noreturn__))
366 #define __MINGW_ATTRIB_CONST __attribute__((__const__))
367 #else
368 #define __MINGW_ATTRIB_NORETURN
369 #define __MINGW_ATTRIB_CONST
370 #endif
371
372 #if __MINGW_GNUC_PREREQ (3, 0)
373 #define __MINGW_ATTRIB_MALLOC __attribute__((__malloc__))
374 #define __MINGW_ATTRIB_PURE __attribute__((__pure__))
375 #else
376 #define __MINGW_ATTRIB_MALLOC
377 #define __MINGW_ATTRIB_PURE
378 #endif
379
380 /* Attribute `nonnull' was valid as of gcc 3.3.  We don't use GCC's
381    variadiac macro facility, because variadic macros cause syntax
382    errors with  --traditional-cpp.  */
383 #if  __MINGW_GNUC_PREREQ (3, 3)
384 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__((__nonnull__(arg)))
385 #else
386 #define __MINGW_ATTRIB_NONNULL(arg)
387 #endif /* GNUC >= 3.3 */
388
389 #if  __MINGW_GNUC_PREREQ (3, 1)
390 #define __MINGW_ATTRIB_DEPRECATED __attribute__((__deprecated__))
391 #else
392 #define __MINGW_ATTRIB_DEPRECATED
393 #endif /* GNUC >= 3.1 */
394
395 #if  __MINGW_GNUC_PREREQ (3, 3)
396 #define __MINGW_NOTHROW __attribute__((__nothrow__))
397 #else
398 #define __MINGW_NOTHROW
399 #endif /* GNUC >= 3.3 */
400
401
402 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW.  This will
403 allow GCC to optimize away some EH unwind code, at least in DW2 case.  */
404
405 /* Activation of MinGW specific extended features:
406  */
407 #ifdef __USE_MINGW_ANSI_STDIO
408 /* Users should not set this directly; rather, define one (or more)
409  * of the feature test macros (tabulated below), or specify any of the
410  * compiler's command line options, (e.g. -posix, -ansi, or -std=c...),
411  * which cause _POSIX_SOURCE, or __STRICT_ANSI__ to be defined.
412  */
413 # warning "Direct definition of __USE_MINGW_ANSI_STDIO is deprecated."
414 # pragma message "See <_mingw.h> for preferred feature activation methods."
415
416 #else   /* ! defined __USE_MINGW_ANSI_STDIO */
417 /* We must check this BEFORE we specifiy any implicit _POSIX_C_SOURCE,
418  * otherwise we would always implicitly choose __USE_MINGW_ANSI_STDIO,
419  * even if none of these selectors are specified explicitly...
420  */
421 # if  defined __STRICT_ANSI__  ||  defined _SVID_SOURCE            \
422   ||  defined _ISOC99_SOURCE   ||  defined _ISOC11_SOURCE          \
423   ||  defined _POSIX_SOURCE    ||  defined _POSIX_C_SOURCE         \
424   ||  defined _XOPEN_SOURCE    ||  defined _XOPEN_SOURCE_EXTENDED  \
425   ||  defined _GNU_SOURCE      ||  defined _BSD_SOURCE
426   /*
427    * but where any of these source code qualifiers are specified,
428    * then assume ANSI I/O standards are preferred over Microsoft's...
429    */
430 #  define __USE_MINGW_ANSI_STDIO   __MINGW_ANSI_STDIO__
431 # else
432   /* otherwise use whatever __MINGW_FEATURES__ specifies...
433    */
434 #  define __USE_MINGW_ANSI_STDIO  (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__)
435 # endif
436 #endif
437
438 /* Some applications may define _XOPEN_SOURCE, without assigning any
439  * value to it.  Such usage may have been permitted in early SUS, but
440  * it became obsolete as of SUSv2.  Attempt to detect obsolete usage,
441  * as it makes an effective evaluation of any _XOPEN_SOURCE version
442  * dependency difficult, (without the use of ugly kludges at EVERY
443  * point of reference which attempts a version comparison).
444  */
445 #define __paste(prefix,suffix)  prefix ## suffix
446 #define __valueless(token)  ((token - 0) == 0) && (__paste(token,10) == 10)
447
448 #if defined _XOPEN_SOURCE && __valueless(_XOPEN_SOURCE)
449 /* _XOPEN_SOURCE appears to have been defined without its mandatory
450  * value; diagnose this brain-damaged obsolete usage (verbosely)...
451  */
452 #warning "_XOPEN_SOURCE seems to have been improperly defined."
453 #warning "Mandatory _XOPEN_SOURCE value assignment appears to be missing."
454 #warning "Redefining _XOPEN_SOURCE to mitigate obsolete misuse."
455
456 /* ...and redefine, emulating implicit behaviour of -D_XOPEN_SOURCE on
457  * the GCC command line, (which DOES assign an implied value of one).
458  */
459 #undef  _XOPEN_SOURCE
460 #define _XOPEN_SOURCE  1
461 #endif
462
463 #ifndef _POSIX_C_SOURCE
464  /* Users may define this, either directly or indirectly, to explicitly
465   * enable a particular level of visibility for the subset of those POSIX
466   * features which are supported by MinGW; (notice that this offers no
467   * guarantee that any particular POSIX feature will be supported).
468   */
469 # if defined _XOPEN_SOURCE
470   /* Specifying this is the preferred method for setting _POSIX_C_SOURCE;
471    * (POSIX defines an explicit relationship to _XOPEN_SOURCE).  Note that
472    * any such explicit setting will augment the set of features which are
473    * available to any compilation unit, even if it seeks to be strictly
474    * ANSI-C compliant.
475    */
476 #  if _XOPEN_SOURCE < 500
477 #   define _POSIX_C_SOURCE  1L          /* POSIX.1-1990 / SUSv1 */
478
479 #  elif _XOPEN_SOURCE < 600
480 #   define _POSIX_C_SOURCE  199506L     /* POSIX.1-1996 / SUSv2 */
481
482 #  elif _XOPEN_SOURCE < 700
483 #   define _POSIX_C_SOURCE  200112L     /* POSIX.1-2001 / SUSv3 */
484
485 #  else
486 #   define _POSIX_C_SOURCE  200809L     /* POSIX.1-2008 / SUSv4 */
487 #  endif
488
489 # elif defined _GNU_SOURCE || defined _BSD_SOURCE || ! defined __STRICT_ANSI__
490   /*
491    * No explicit level of support has been specified; implicitly grant
492    * the most comprehensive level to any compilation unit which requests
493    * either GNU or BSD feature support, or does not seek to be strictly
494    * ANSI-C compliant.
495    */
496 #  define _POSIX_C_SOURCE  200809L
497
498 #  if ! defined _EMULATE_GLIBC && ! defined _POSIX_SOURCE
499    /* For this default case, unless it has already been specified
500     * otherwise, we enable some GNU glibc extensions, which may be
501     * considered as violations of strict POSIX.1 conformance.
502     */
503 #   define _EMULATE_GLIBC  1
504 #  endif
505
506 # elif defined _POSIX_SOURCE
507   /* Now formally deprecated by POSIX, some old code may specify this;
508    * it will enable a minimal level of POSIX support, in addition to the
509    * limited feature set enabled for strict ANSI-C conformity.
510    */
511 #  define _POSIX_C_SOURCE  1L
512 # endif
513 #endif
514
515 #if _POSIX_C_SOURCE >= 199506L
516 /* Conformance with POSIX.1-1996 has been requested; ensure that any
517  * interfaces which have been marked as "obsolescent", from this POSIX
518  * version onwards, will be reported as "deprecated", at point of use.
519  */
520 # define __POSIX_1996_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
521 #else
522 /* POSIX.1-1996 conformance is NOT required; do not object to use of
523  * interfaces which became "obsolescent" in this POSIX version, but
524  * were still fully supported in earlier versions.
525  */
526 # define __POSIX_1996_DEPRECATED
527 #endif
528
529 #if _POSIX_C_SOURCE >= 200112L
530 /* Conformance with POSIX.1-2001 has been requested; ensure that any
531  * interfaces which have been marked as "obsolescent", from this POSIX
532  * version onwards, will be reported as "deprecated", at point of use.
533  */
534 # define __POSIX_2001_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
535 #else
536 /* POSIX.1-2001 conformance is NOT required; do not object to use of
537  * interfaces which became "obsolescent" in this POSIX version, but
538  * were still fully supported in earlier versions.
539  */
540 # define __POSIX_2001_DEPRECATED
541 #endif
542
543 #if _POSIX_C_SOURCE >= 200809L
544 /* Conformance with POSIX.1-2008 has been requested; ensure that any
545  * interfaces which have been marked as "obsolescent", from this POSIX
546  * version onwards, will be reported as "deprecated", at point of use.
547  */
548 # define __POSIX_2008_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
549 #else
550 /* POSIX.1-2008 conformance is NOT required; do not object to use of
551  * interfaces which became "obsolescent" in this POSIX version, but
552  * were still fully supported in earlier versions.
553  */
554 # define __POSIX_2008_DEPRECATED
555 #endif
556
557 #ifndef _ISOC99_SOURCE
558  /* libmingwex.a provides free-standing implementations for many of the
559   * functions which were introduced in C99; MinGW headers do not expose
560   * prototypes for these, unless this feature test macro is defined, by
561   * the user, or implied by other standards.  We will use a bit-mapped
562   * representation, comprising the bit-wise sum of:
563   *
564   *   0x08  user declared
565   *   0x04  required by C compiler, supporting ISO-C99
566   *   0x02  required by C++ compiler, supporting ISO-C++11
567   *   0x01  required to support recent POSIX.1 features
568   *
569   * to ensure that we can identify the reason for implicit declaration,
570   * (in the event that we may need to discriminate).
571   */
572 # if __STDC_VERSION__ >= 199901L
573   /* This represents a compiler supporting ISO-C99; enable all potential
574    * use of ISO-C99 features, (to the maximum extent supportable), which
575    * presumably also covers all C++11 and POSIX.1 usage.
576    */
577 #  define _ISOC99_SOURCE  0x07
578
579 # elif __cplusplus >= 201103L
580   /* C++11 also incorporates many (if not all) of the ISO-C99 features,
581    * which we have guarded by _ISOC99_SOURCE; enable such features, to
582    * the required extent, (which is likely also sufficient to support
583    * any POSIX.1 dependencies).
584    */
585 #  define _ISOC99_SOURCE  0x03
586
587 # elif _POSIX_C_SOURCE >= 200112L
588   /* This represents the minimum level of ISO-C99 support, which may be
589    * required by POSIX.1, (and which may be no less than full support).
590    */
591 #  define _ISOC99_SOURCE  0x01
592 # endif
593
594 #else
595  /* The the user has explicitly declared a source level dependency on
596   * ISO-C99 features; regardless of how it was declared, redefine it to
597   * ensure that any plausible dependency is covered.
598   */
599 # undef _ISOC99_SOURCE
600 # define _ISOC99_SOURCE  0x0F
601
602 #endif  /* _ISOC99_SOURCE */
603
604 #if _ISOC99_SOURCE && __cplusplus >= 201103L && __GNUC__ < 6
605  /* Due to a configuration defect in GCC versions prior to GCC-6, when
606   * compiling C++11 code, the ISO-C99 functions may not be incorporated
607   * into the appropriate namespace(s); we may be able to mitigate this,
608   * by ensuring that these GCC configuration macros are defined.
609   */
610 # define _GLIBCXX_USE_C99       1
611 # define _GLIBCXX_HAVE_WCSTOF   1
612 #endif
613
614 #if ! defined _MINGW32_SOURCE_EXTENDED && ! defined __STRICT_ANSI__
615  /* Enable mingw32 extensions by default, except when __STRICT_ANSI__
616   * conformity mode has been enabled.
617   */
618 # define _MINGW32_SOURCE_EXTENDED  1
619 #endif
620
621 #endif /* __MINGW_H: $RCSfile$: end of file */