Enchant: config.h Source File

Enchant Generic spell checking library

config.h
1 /* config.h. Generated from config.h.in by configure. */
2 /* config.h.in. Generated from configure.ac by autoheader. */
3
4 /* Witness that <config.h> has been included. */
5 #define _GL_CONFIG_H_INCLUDED 1
6
7
8 /* Define to the number of bits in type 'ptrdiff_t'. */
9 /* #undef BITSIZEOF_PTRDIFF_T */
10
11 /* Define to the number of bits in type 'sig_atomic_t'. */
12 /* #undef BITSIZEOF_SIG_ATOMIC_T */
13
14 /* Define to the number of bits in type 'size_t'. */
15 /* #undef BITSIZEOF_SIZE_T */
16
17 /* Define to the number of bits in type 'wchar_t'. */
18 /* #undef BITSIZEOF_WCHAR_T */
19
20 /* Define to the number of bits in type 'wint_t'. */
21 /* #undef BITSIZEOF_WINT_T */
22
23 /* Define to 1 if the package shall run at any location in the file system. */
24 #define ENABLE_RELOCATABLE 1
25
26 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
27 whether the gnulib module msvc-nothrow shall be considered present. */
28 #define GNULIB_MSVC_NOTHROW 1
29
30 /* Define to 1 when the gnulib module rawmemchr should be tested. */
31 #define GNULIB_TEST_RAWMEMCHR 1
32
33 /* Define to 1 when the gnulib module strchrnul should be tested. */
34 #define GNULIB_TEST_STRCHRNUL 1
35
36 /* Define to 1 if you have the <aspell.h> header file. */
37 #define HAVE_ASPELL_H 1
38
39 /* Define to 1 if you have the <Cocoa/Cocoa.h> header file. */
40 /* #undef HAVE_COCOA_COCOA_H */
41
42 /* define if the compiler supports basic C++11 syntax */
43 #define HAVE_CXX11 1
44
45 /* Define to 1 if the alignas and alignof keywords work. */
46 /* #undef HAVE_C_ALIGNASOF */
47
48 /* Define to 1 if the static_assert keyword works. */
49 /* #undef HAVE_C_STATIC_ASSERT */
50
51 /* Define to 1 if you have the declaration of `ecvt', and to 0 if you don't.
52 */
53 #define HAVE_DECL_ECVT 1
54
55 /* Define to 1 if you have the declaration of `execvpe', and to 0 if you
56 don't. */
57 #define HAVE_DECL_EXECVPE 1
58
59 /* Define to 1 if you have the declaration of `fcvt', and to 0 if you don't.
60 */
61 #define HAVE_DECL_FCVT 1
62
63 /* Define to 1 if you have the declaration of `gcvt', and to 0 if you don't.
64 */
65 #define HAVE_DECL_GCVT 1
66
67 /* Define to 1 if you have the <dlfcn.h> header file. */
68 #define HAVE_DLFCN_H 1
69
70 /* Define to 1 if you have the `fcntl' function. */
71 #define HAVE_FCNTL 1
72
73 /* Define to 1 if you have the `flock' function. */
74 #define HAVE_FLOCK 1
75
76 /* Define to 1 if you have the <hspell.h> header file. */
77 #define HAVE_HSPELL_H 1
78
79 /* Define to 1 if you have the <inttypes.h> header file. */
80 #define HAVE_INTTYPES_H 1
81
82 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
83 #define HAVE_LANGINFO_CODESET 1
84
85 /* Define if your <locale.h> file defines LC_MESSAGES. */
86 #define HAVE_LC_MESSAGES 1
87
88 /* Define to 1 if you have the `applespell' library (-lapplespell). */
89 /* #undef HAVE_LIBAPPLESPELL */
90
91 /* Define to 1 if you have the `aspell' library (-laspell). */
92 #define HAVE_LIBASPELL 1
93
94 /* Define to 1 if you have the `hspell' library (-lhspell). */
95 #define HAVE_LIBHSPELL 1
96
97 /* Define to 1 if you have the <limits.h> header file. */
98 #define HAVE_LIMITS_H 1
99
100 /* Define to 1 if you have the <locale.h> header file. */
101 #define HAVE_LOCALE_H 1
102
103 /* Define to 1 if the system has the type 'long long int'. */
104 #define HAVE_LONG_LONG_INT 1
105
106 /* Define to 1 if you have the <minix/config.h> header file. */
107 /* #undef HAVE_MINIX_CONFIG_H */
108
109 /* Define to 1 on MSVC platforms that have the "invalid parameter handler"
110 concept. */
111 /* #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER */
112
113 /* Define to 1 if you have the `rawmemchr' function. */
114 #define HAVE_RAWMEMCHR 1
115
116 /* Define to 1 if 'sig_atomic_t' is a signed integer type. */
117 /* #undef HAVE_SIGNED_SIG_ATOMIC_T */
118
119 /* Define to 1 if 'wchar_t' is a signed integer type. */
120 /* #undef HAVE_SIGNED_WCHAR_T */
121
122 /* Define to 1 if 'wint_t' is a signed integer type. */
123 /* #undef HAVE_SIGNED_WINT_T */
124
125 /* Define to 1 if you have the <stdint.h> header file. */
126 #define HAVE_STDINT_H 1
127
128 /* Define to 1 if you have the <stdio.h> header file. */
129 #define HAVE_STDIO_H 1
130
131 /* Define to 1 if you have the <stdlib.h> header file. */
132 #define HAVE_STDLIB_H 1
133
134 /* Define to 1 if you have the `strchrnul' function. */
135 #define HAVE_STRCHRNUL 1
136
137 /* Define to 1 if you have the <strings.h> header file. */
138 #define HAVE_STRINGS_H 1
139
140 /* Define to 1 if you have the <string.h> header file. */
141 #define HAVE_STRING_H 1
142
143 /* Define to 1 if `l_type' is a member of `struct flock'. */
144 /* #undef HAVE_STRUCT_FLOCK_L_TYPE */
145
146 /* Define to 1 if you have the <sys/bitypes.h> header file. */
147 /* #undef HAVE_SYS_BITYPES_H */
148
149 /* Define to 1 if you have the <sys/file.h> header file. */
150 #define HAVE_SYS_FILE_H 1
151
152 /* Define to 1 if you have the <sys/inttypes.h> header file. */
153 /* #undef HAVE_SYS_INTTYPES_H */
154
155 /* Define to 1 if you have the <sys/stat.h> header file. */
156 #define HAVE_SYS_STAT_H 1
157
158 /* Define to 1 if you have the <sys/types.h> header file. */
159 #define HAVE_SYS_TYPES_H 1
160
161 /* Define to 1 if you have the <unistd.h> header file. */
162 #define HAVE_UNISTD_H 1
163
164 /* Define to 1 if the system has the type 'unsigned long long int'. */
165 #define HAVE_UNSIGNED_LONG_LONG_INT 1
166
167 /* Define to 1 if you have the <wchar.h> header file. */
168 #define HAVE_WCHAR_H 1
169
170 /* Define if you have the 'wchar_t' type. */
171 #define HAVE_WCHAR_T 1
172
173 /* Define if you have the 'wint_t' type. */
174 #define HAVE_WINT_T 1
175
176 /* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
177 /* #undef HAVE__SET_INVALID_PARAMETER_HANDLER */
178
179 /* Define to 1 if ctype.h defines __header_inline. */
180 /* #undef HAVE___HEADER_INLINE */
181
182 /* Please see the Gnulib manual for how to use these macros.
183
184 Suppress extern inline with HP-UX cc, as it appears to be broken; see
185 <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
186
187 Suppress extern inline with Sun C in standards-conformance mode, as it
188 mishandles inline functions that call each other. E.g., for 'inline void f
189 (void) { } inline void g (void) { f (); }', c99 incorrectly complains
190 'reference to static identifier "f" in extern inline function'.
191 This bug was observed with Oracle Developer Studio 12.6
192 (Sun C 5.15 SunOS_sparc 2017/05/30).
193
194 Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
195 on configurations that mistakenly use 'static inline' to implement
196 functions or macros in standard C headers like <ctype.h>. For example,
197 if isdigit is mistakenly implemented via a static inline function,
198 a program containing an extern inline function that calls isdigit
199 may not work since the C standard prohibits extern inline functions
200 from calling static functions (ISO C 99 section 6.7.4.(3).
201 This bug is known to occur on:
202
203 OS X 10.8 and earlier; see:
204 https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
205
206 DragonFly; see
207 http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
208
209 FreeBSD; see:
210 https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
211
212 OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
213 for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
214 Assume DragonFly and FreeBSD will be similar.
215
216 GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
217 inline semantics, unless -fgnu89-inline is used. It defines a macro
218 __GNUC_STDC_INLINE__ to indicate this situation or a macro
219 __GNUC_GNU_INLINE__ to indicate the opposite situation.
220 GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
221 semantics but warns, unless -fgnu89-inline is used:
222 warning: C99 inline functions are not supported; using GNU89
223 warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
224 It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
225 */
226 #if (((defined __APPLE__ && defined __MACH__) \
227 || defined __DragonFly__ || defined __FreeBSD__) \
228 && (defined HAVE___HEADER_INLINE \
229 ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
230 && ! defined __clang__) \
231 : ((! defined _DONT_USE_CTYPE_INLINE_ \
232 && (defined __GNUC__ || defined __cplusplus)) \
233 || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
234 && defined __GNUC__ && ! defined __cplusplus))))
235 # define _GL_EXTERN_INLINE_STDHEADER_BUG
236 #endif
237 #if ((__GNUC__ \
238 ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
239 && !defined __PCC__) \
240 : (199901L <= __STDC_VERSION__ \
241 && !defined __HP_cc \
242 && !defined __PGI \
243 && !(defined __SUNPRO_C && __STDC__))) \
244 && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
245 # define _GL_INLINE inline
246 # define _GL_EXTERN_INLINE extern inline
247 # define _GL_EXTERN_INLINE_IN_USE
248 #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
249 && !defined __PCC__ \
250 && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
251 # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
252 /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
253 # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
254 # else
255 # define _GL_INLINE extern inline
256 # endif
257 # define _GL_EXTERN_INLINE extern
258 # define _GL_EXTERN_INLINE_IN_USE
259 #else
260 # define _GL_INLINE _GL_UNUSED static
261 # define _GL_EXTERN_INLINE _GL_UNUSED static
262 #endif
263
264 /* In GCC 4.6 (inclusive) to 5.1 (exclusive),
265 suppress bogus "no previous prototype for 'FOO'"
266 and "no previous declaration for 'FOO'" diagnostics,
267 when FOO is an inline function in the header; see
268 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
269 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
270 #if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
271 # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
272 # define _GL_INLINE_HEADER_CONST_PRAGMA
273 # else
274 # define _GL_INLINE_HEADER_CONST_PRAGMA \
275 _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
276 # endif
277 # define _GL_INLINE_HEADER_BEGIN \
278 _Pragma ("GCC diagnostic push") \
279 _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
280 _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
281 _GL_INLINE_HEADER_CONST_PRAGMA
282 # define _GL_INLINE_HEADER_END \
283 _Pragma ("GCC diagnostic pop")
284 #else
285 # define _GL_INLINE_HEADER_BEGIN
286 # define _GL_INLINE_HEADER_END
287 #endif
288
289 /* Define to the value of ${prefix}, as a string. */
290 #define INSTALLPREFIX "/home/rrt/.local"
291
292 /* Define to the extension used for runtime loadable modules, say, ".so". */
293 #define LT_MODULE_EXT ".so"
294
295 /* Define to the sub-directory where libtool stores uninstalled libraries. */
296 #define LT_OBJDIR ".libs/"
297
298 /* Define to the shared library suffix, say, ".dylib". */
299 /* #undef LT_SHARED_EXT */
300
301 /* Define to the shared archive member specification, say "(shr.o)". */
302 /* #undef LT_SHARED_LIB_MEMBER */
303
304 /* Name of package */
305 #define PACKAGE "enchant"
306
307 /* Define to the address where bug reports for this package should be sent. */
308 #define PACKAGE_BUGREPORT ""
309
310 /* Define to the full name of this package. */
311 #define PACKAGE_NAME "enchant"
312
313 /* Define to the full name and version of this package. */
314 #define PACKAGE_STRING "enchant 2.6.8"
315
316 /* Define to the one symbol short name of this package. */
317 #define PACKAGE_TARNAME "enchant"
318
319 /* Define to the home page for this package. */
320 #define PACKAGE_URL ""
321
322 /* Define to the version of this package. */
323 #define PACKAGE_VERSION "2.6.8"
324
325 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
326 'ptrdiff_t'. */
327 /* #undef PTRDIFF_T_SUFFIX */
328
329 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
330 'sig_atomic_t'. */
331 /* #undef SIG_ATOMIC_T_SUFFIX */
332
333 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
334 'size_t'. */
335 /* #undef SIZE_T_SUFFIX */
336
337 /* Define to 1 if all of the C90 standard headers exist (not just the ones
338 required in a freestanding environment). This macro is provided for
339 backward compatibility; new code need not use it. */
340 #define STDC_HEADERS 1
341
342 /* Enable extensions on AIX 3, Interix. */
343 #ifndef _ALL_SOURCE
344 # define _ALL_SOURCE 1
345 #endif
346 /* Enable general extensions on macOS. */
347 #ifndef _DARWIN_C_SOURCE
348 # define _DARWIN_C_SOURCE 1
349 #endif
350 /* Enable general extensions on Solaris. */
351 #ifndef __EXTENSIONS__
352 # define __EXTENSIONS__ 1
353 #endif
354 /* Enable GNU extensions on systems that have them. */
355 #ifndef _GNU_SOURCE
356 # define _GNU_SOURCE 1
357 #endif
358 /* Enable X/Open compliant socket functions that do not require linking
359 with -lxnet on HP-UX 11.11. */
360 #ifndef _HPUX_ALT_XOPEN_SOCKET_API
361 # define _HPUX_ALT_XOPEN_SOCKET_API 1
362 #endif
363 /* Identify the host operating system as Minix.
364 This macro does not affect the system headers' behavior.
365 A future release of Autoconf may stop defining this macro. */
366 #ifndef _MINIX
367 /* # undef _MINIX */
368 #endif
369 /* Enable general extensions on NetBSD.
370 Enable NetBSD compatibility extensions on Minix. */
371 #ifndef _NETBSD_SOURCE
372 # define _NETBSD_SOURCE 1
373 #endif
374 /* Enable OpenBSD compatibility extensions on NetBSD.
375 Oddly enough, this does nothing on OpenBSD. */
376 #ifndef _OPENBSD_SOURCE
377 # define _OPENBSD_SOURCE 1
378 #endif
379 /* Define to 1 if needed for POSIX-compatible behavior. */
380 #ifndef _POSIX_SOURCE
381 /* # undef _POSIX_SOURCE */
382 #endif
383 /* Define to 2 if needed for POSIX-compatible behavior. */
384 #ifndef _POSIX_1_SOURCE
385 /* # undef _POSIX_1_SOURCE */
386 #endif
387 /* Enable POSIX-compatible threading on Solaris. */
388 #ifndef _POSIX_PTHREAD_SEMANTICS
389 # define _POSIX_PTHREAD_SEMANTICS 1
390 #endif
391 /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
392 #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
393 # define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
394 #endif
395 /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
396 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
397 # define __STDC_WANT_IEC_60559_BFP_EXT__ 1
398 #endif
399 /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
400 #ifndef __STDC_WANT_IEC_60559_DFP_EXT__
401 # define __STDC_WANT_IEC_60559_DFP_EXT__ 1
402 #endif
403 /* Enable extensions specified by C23 Annex F. */
404 #ifndef __STDC_WANT_IEC_60559_EXT__
405 # define __STDC_WANT_IEC_60559_EXT__ 1
406 #endif
407 /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
408 #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
409 # define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
410 #endif
411 /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
412 #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
413 # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
414 #endif
415 /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
416 #ifndef __STDC_WANT_LIB_EXT2__
417 # define __STDC_WANT_LIB_EXT2__ 1
418 #endif
419 /* Enable extensions specified by ISO/IEC 24747:2009. */
420 #ifndef __STDC_WANT_MATH_SPEC_FUNCS__
421 # define __STDC_WANT_MATH_SPEC_FUNCS__ 1
422 #endif
423 /* Enable extensions on HP NonStop. */
424 #ifndef _TANDEM_SOURCE
425 # define _TANDEM_SOURCE 1
426 #endif
427 /* Enable X/Open extensions. Define to 500 only if necessary
428 to make mbstate_t available. */
429 #ifndef _XOPEN_SOURCE
430 /* # undef _XOPEN_SOURCE */
431 #endif
432
433
434 /* Version number of package */
435 #define VERSION "2.6.8"
436
437 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
438 'wchar_t'. */
439 /* #undef WCHAR_T_SUFFIX */
440
441 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
442 'wint_t'. */
443 /* #undef WINT_T_SUFFIX */
444
445 /* True if the compiler says it groks GNU C version MAJOR.MINOR. */
446 #if defined __GNUC__ && defined __GNUC_MINOR__
447 # define _GL_GNUC_PREREQ(major, minor) \
448 ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
449 #else
450 # define _GL_GNUC_PREREQ(major, minor) 0
451 #endif
452
453
454 /* Define to enable the declarations of ISO C 11 types and functions. */
455 /* #undef _ISOC11_SOURCE */
456
457 /* The _Noreturn keyword of C11. */
458 #ifndef _Noreturn
459 # if (defined __cplusplus \
460 && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
461 || (defined _MSC_VER && 1900 <= _MSC_VER)) \
462 && 0)
463 /* [[noreturn]] is not practically usable, because with it the syntax
464 extern _Noreturn void func (...);
465 would not be valid; such a declaration would only be valid with 'extern'
466 and '_Noreturn' swapped, or without the 'extern' keyword. However, some
467 AIX system header files and several gnulib header files use precisely
468 this syntax with 'extern'. */
469 # define _Noreturn [[noreturn]]
470 # elif (defined __clang__ && __clang_major__ < 16 \
471 && defined _GL_WORK_AROUND_LLVM_BUG_59792)
472 /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
473 that rare LLVM bug, though you may get many false-alarm warnings. */
474 # define _Noreturn
475 # elif ((!defined __cplusplus || defined __clang__) \
476 && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
477 || (!defined __STRICT_ANSI__ \
478 && (_GL_GNUC_PREREQ (4, 7) \
479 || (defined __apple_build_version__ \
480 ? 6000000 <= __apple_build_version__ \
481 : 3 < __clang_major__ + (5 <= __clang_minor__))))))
482 /* _Noreturn works as-is. */
483 # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
484 # define _Noreturn __attribute__ ((__noreturn__))
485 # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
486 # define _Noreturn __declspec (noreturn)
487 # else
488 # define _Noreturn
489 # endif
490 #endif
491
492
493 /* For standard stat data types on VMS. */
494 #define _USE_STD_STAT 1
495
496 /* Define to 1 if the system <stdint.h> predates C++11. */
497 /* #undef __STDC_CONSTANT_MACROS */
498
499 /* Define to 1 if the system <stdint.h> predates C++11. */
500 /* #undef __STDC_LIMIT_MACROS */
501
502 /* The _GL_ASYNC_SAFE marker should be attached to functions that are
503 signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
504 invoked from such signal handlers. Such functions have some restrictions:
505 * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
506 or should be listed as async-signal-safe in POSIX
507 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
508 section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
509 particular, are NOT async-signal-safe.
510 * All memory locations (variables and struct fields) that these functions
511 access must be marked 'volatile'. This holds for both read and write
512 accesses. Otherwise the compiler might optimize away stores to and
513 reads from such locations that occur in the program, depending on its
514 data flow analysis. For example, when the program contains a loop
515 that is intended to inspect a variable set from within a signal handler
516 while (!signal_occurred)
517 ;
518 the compiler is allowed to transform this into an endless loop if the
519 variable 'signal_occurred' is not declared 'volatile'.
520 Additionally, recall that:
521 * A signal handler should not modify errno (except if it is a handler
522 for a fatal signal and ends by raising the same signal again, thus
523 provoking the termination of the process). If it invokes a function
524 that may clobber errno, it needs to save and restore the value of
525 errno. */
526 #define _GL_ASYNC_SAFE
527
528
529 /* Attributes. */
530 #if (defined __has_attribute \
531 && (!defined __clang_minor__ \
532 || (defined __apple_build_version__ \
533 ? 6000000 <= __apple_build_version__ \
534 : 5 <= __clang_major__)))
535 # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
536 #else
537 # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
538 # define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
539 # define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
540 # define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
541 # define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
542 # define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
543 # define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
544 # define _GL_ATTR_diagnose_if 0
545 # define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
546 # define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
547 # define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
548 # define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
549 # define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
550 # define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
551 # ifdef _ICC
552 # define _GL_ATTR_may_alias 0
553 # else
554 # define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
555 # endif
556 # define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
557 # define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
558 # define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
559 # define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
560 # define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
561 # define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
562 # define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
563 # define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
564 # define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
565 # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
566 #endif
567
568 /* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
569 #if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
570 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
571 # pragma GCC diagnostic ignored "-Wpedantic"
572 #endif
573
574 /* Define if, in a function declaration, the attributes in bracket syntax
575 [[...]] must come before the attributes in __attribute__((...)) syntax.
576 If this is defined, it is best to avoid the bracket syntax, so that the
577 various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
578 order. */
579 #ifdef __cplusplus
580 # if defined __clang__
581 # define _GL_BRACKET_BEFORE_ATTRIBUTE 1
582 # endif
583 #else
584 # if defined __GNUC__ && !defined __clang__
585 # define _GL_BRACKET_BEFORE_ATTRIBUTE 1
586 # endif
587 #endif
588
589 /* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
590 is the size of the returned memory block.
591 _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
592 by the Nth argument of the function is the size of the returned memory block.
593 */
594 /* Applies to: function, pointer to function, function types. */
595 #ifndef _GL_ATTRIBUTE_ALLOC_SIZE
596 # if _GL_HAS_ATTRIBUTE (alloc_size)
597 # define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
598 # else
599 # define _GL_ATTRIBUTE_ALLOC_SIZE(args)
600 # endif
601 #endif
602
603 /* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
604 function and report an error if it cannot do so. */
605 /* Applies to: function. */
606 #ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
607 # if _GL_HAS_ATTRIBUTE (always_inline)
608 # define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
609 # else
610 # define _GL_ATTRIBUTE_ALWAYS_INLINE
611 # endif
612 #endif
613
614 /* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
615 in stack traces when debugging. The compiler should omit the function from
616 stack traces. */
617 /* Applies to: function. */
618 #ifndef _GL_ATTRIBUTE_ARTIFICIAL
619 # if _GL_HAS_ATTRIBUTE (artificial)
620 # define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
621 # else
622 # define _GL_ATTRIBUTE_ARTIFICIAL
623 # endif
624 #endif
625
626 /* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
627 /* Applies to: functions. */
628 /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
629 <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
630 Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
631 #ifndef _GL_ATTRIBUTE_COLD
632 # if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
633 # ifndef __SUNPRO_C
634 # define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
635 # else
636 # define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
637 # endif
638 # else
639 # define _GL_ATTRIBUTE_COLD
640 # endif
641 #endif
642
643 /* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
644 calls to the function with the same arguments.
645 This attribute is safe for a function that neither depends on nor affects
646 observable state, and always returns exactly once - e.g., does not loop
647 forever, and does not call longjmp.
648 (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
649 /* Applies to: functions. */
650 #ifndef _GL_ATTRIBUTE_CONST
651 # if _GL_HAS_ATTRIBUTE (const)
652 # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
653 # else
654 # define _GL_ATTRIBUTE_CONST
655 # endif
656 #endif
657
658 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
659 that can be freed by passing them as the Ith argument to the
660 function F.
661 _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
662 can be freed via 'free'; it can be used only after declaring 'free'. */
663 /* Applies to: functions. Cannot be used on inline functions. */
664 #ifndef _GL_ATTRIBUTE_DEALLOC
665 # if _GL_GNUC_PREREQ (11, 0)
666 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
667 # else
668 # define _GL_ATTRIBUTE_DEALLOC(f, i)
669 # endif
670 #endif
671 /* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
672 to use this earlier definition, since <stdlib.h> may not have been included
673 yet. */
674 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
675 # if defined __cplusplus && defined __GNUC__ && !defined __clang__
676 /* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
677 # define _GL_ATTRIBUTE_DEALLOC_FREE \
678 _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
679 # else
680 # define _GL_ATTRIBUTE_DEALLOC_FREE \
681 _GL_ATTRIBUTE_DEALLOC (free, 1)
682 # endif
683 #endif
684
685 /* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
686 The compiler may warn if the entity is used. */
687 /* Applies to:
688 - function, variable,
689 - struct, union, struct/union member,
690 - enumeration, enumeration item,
691 - typedef,
692 in C++ also: namespace, class, template specialization. */
693 #ifndef _GL_ATTRIBUTE_DEPRECATED
694 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
695 # ifdef __has_c_attribute
696 # if __has_c_attribute (__deprecated__)
697 # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
698 # endif
699 # endif
700 # endif
701 # if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
702 # define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
703 # endif
704 # ifndef _GL_ATTRIBUTE_DEPRECATED
705 # define _GL_ATTRIBUTE_DEPRECATED
706 # endif
707 #endif
708
709 /* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
710 the function call is not optimized away.
711 _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
712 the function call is not optimized away. */
713 /* Applies to: functions. */
714 #if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
715 # if _GL_HAS_ATTRIBUTE (error)
716 # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
717 # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
718 # elif _GL_HAS_ATTRIBUTE (diagnose_if)
719 # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
720 # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
721 # else
722 # define _GL_ATTRIBUTE_ERROR(msg)
723 # define _GL_ATTRIBUTE_WARNING(msg)
724 # endif
725 #endif
726
727 /* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
728 visible to debuggers etc., even with '-fwhole-program'. */
729 /* Applies to: functions, variables. */
730 #ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
731 # if _GL_HAS_ATTRIBUTE (externally_visible)
732 # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
733 # else
734 # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
735 # endif
736 #endif
737
738 /* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
739 the control flow falls through to the immediately following 'case' or
740 'default' label. The compiler should not warn in this case. */
741 /* Applies to: Empty statement (;), inside a 'switch' statement. */
742 /* Always expands to something. */
743 #ifndef _GL_ATTRIBUTE_FALLTHROUGH
744 # ifdef __has_c_attribute
745 # if __has_c_attribute (__fallthrough__)
746 # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
747 # endif
748 # endif
749 # if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough)
750 # define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
751 # endif
752 # ifndef _GL_ATTRIBUTE_FALLTHROUGH
753 # define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
754 # endif
755 #endif
756
757 /* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
758 declares that the STRING-INDEXth function argument is a format string of
759 style ARCHETYPE, which is one of:
760 printf, gnu_printf
761 scanf, gnu_scanf,
762 strftime, gnu_strftime,
763 strfmon,
764 or the same thing prefixed and suffixed with '__'.
765 If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
766 are suitable for the format string. */
767 /* Applies to: functions. */
768 #ifndef _GL_ATTRIBUTE_FORMAT
769 # if _GL_HAS_ATTRIBUTE (format)
770 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
771 # else
772 # define _GL_ATTRIBUTE_FORMAT(spec)
773 # endif
774 #endif
775
776 /* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
777 compilation unit, it executes code from that unit only by return or by
778 exception handling. This declaration lets the compiler optimize that unit
779 more aggressively. */
780 /* Applies to: functions. */
781 #ifndef _GL_ATTRIBUTE_LEAF
782 # if _GL_HAS_ATTRIBUTE (leaf)
783 # define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
784 # else
785 # define _GL_ATTRIBUTE_LEAF
786 # endif
787 #endif
788
789 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
790 allocated memory. */
791 /* Applies to: functions. */
792 #ifndef _GL_ATTRIBUTE_MALLOC
793 # if _GL_HAS_ATTRIBUTE (malloc)
794 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
795 # else
796 # define _GL_ATTRIBUTE_MALLOC
797 # endif
798 #endif
799
800 /* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
801 same storage as pointers to other types. Thus this declaration disables
802 strict aliasing optimization. */
803 /* Applies to: types. */
804 /* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
805 #ifndef _GL_ATTRIBUTE_MAY_ALIAS
806 # if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
807 # define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
808 # else
809 # define _GL_ATTRIBUTE_MAY_ALIAS
810 # endif
811 #endif
812
813 /* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
814 the entity is not used. The compiler should not warn if the entity is not
815 used. */
816 /* Applies to:
817 - function, variable,
818 - struct, union, struct/union member,
819 - enumeration, enumeration item,
820 - typedef,
821 in C++ also: class. */
822 /* In C++ and C23, this is spelled [[__maybe_unused__]].
823 GCC's syntax is __attribute__ ((__unused__)).
824 clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
825 __has_c_attribute (__maybe_unused__) yields true but the use of
826 [[__maybe_unused__]] nevertheless produces a warning. */
827 #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
828 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
829 # if defined __clang__ && defined __cplusplus
830 # if !defined __apple_build_version__ && __clang_major__ >= 10
831 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
832 # endif
833 # elif defined __has_c_attribute
834 # if __has_c_attribute (__maybe_unused__)
835 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
836 # endif
837 # endif
838 # endif
839 # ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
840 # define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
841 # endif
842 #endif
843 /* Alternative spelling of this macro, for convenience and for
844 compatibility with glibc/include/libc-symbols.h. */
845 #define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
846 /* Earlier spellings of this macro. */
847 #define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
848
849 /* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
850 discard the return value. The compiler may warn if the caller does not use
851 the return value, unless the caller uses something like ignore_value. */
852 /* Applies to: function, enumeration, class. */
853 #ifndef _GL_ATTRIBUTE_NODISCARD
854 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
855 # if defined __clang__ && defined __cplusplus
856 /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
857 a warning.
858 The 1000 below means a yet unknown threshold. When clang++ version X
859 starts supporting [[__nodiscard__]] without warning about it, you can
860 replace the 1000 with X. */
861 # if __clang_major__ >= 1000
862 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
863 # endif
864 # elif defined __has_c_attribute
865 # if __has_c_attribute (__nodiscard__)
866 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
867 # endif
868 # endif
869 # endif
870 # if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
871 # define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
872 # endif
873 # ifndef _GL_ATTRIBUTE_NODISCARD
874 # define _GL_ATTRIBUTE_NODISCARD
875 # endif
876 #endif
877
878 /* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
879 function. */
880 /* Applies to: functions. */
881 #ifndef _GL_ATTRIBUTE_NOINLINE
882 # if _GL_HAS_ATTRIBUTE (noinline)
883 # define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
884 # else
885 # define _GL_ATTRIBUTE_NOINLINE
886 # endif
887 #endif
888
889 /* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
890 must not be NULL.
891 _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
892 null. */
893 /* Applies to: functions. */
894 #ifndef _GL_ATTRIBUTE_NONNULL
895 # if _GL_HAS_ATTRIBUTE (nonnull)
896 # define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
897 # else
898 # define _GL_ATTRIBUTE_NONNULL(args)
899 # endif
900 #endif
901
902 /* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
903 not meant to be NUL-terminated. */
904 /* Applies to: struct/union members and variables that are arrays of element
905 type '[[un]signed] char'. */
906 #ifndef _GL_ATTRIBUTE_NONSTRING
907 # if _GL_HAS_ATTRIBUTE (nonstring)
908 # define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
909 # else
910 # define _GL_ATTRIBUTE_NONSTRING
911 # endif
912 #endif
913
914 /* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
915
916 /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
917 */
918 /* Applies to: functions. */
919 #ifndef _GL_ATTRIBUTE_NOTHROW
920 # if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
921 # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
922 # else
923 # define _GL_ATTRIBUTE_NOTHROW
924 # endif
925 #endif
926
927 /* _GL_ATTRIBUTE_PACKED declares:
928 For struct members: The member has the smallest possible alignment.
929 For struct, union, class: All members have the smallest possible alignment,
930 minimizing the memory required. */
931 /* Applies to: struct members, struct, union,
932 in C++ also: class. */
933 #ifndef _GL_ATTRIBUTE_PACKED
934 # if _GL_HAS_ATTRIBUTE (packed)
935 # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
936 # else
937 # define _GL_ATTRIBUTE_PACKED
938 # endif
939 #endif
940
941 /* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
942 calls to the function with the same arguments if observable state is not
943 changed between calls.
944 This attribute is safe for a function that does not affect
945 observable state, and always returns exactly once.
946 (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
947 /* Applies to: functions. */
948 #ifndef _GL_ATTRIBUTE_PURE
949 # if _GL_HAS_ATTRIBUTE (pure)
950 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
951 # else
952 # define _GL_ATTRIBUTE_PURE
953 # endif
954 #endif
955
956 /* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
957 a non-NULL pointer. */
958 /* Applies to: functions. */
959 #ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
960 # if _GL_HAS_ATTRIBUTE (returns_nonnull)
961 # define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
962 # else
963 # define _GL_ATTRIBUTE_RETURNS_NONNULL
964 # endif
965 #endif
966
967 /* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
968 trailing NULL argument.
969 _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
970 _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
971 /* Applies to: functions. */
972 #ifndef _GL_ATTRIBUTE_SENTINEL
973 # if _GL_HAS_ATTRIBUTE (sentinel)
974 # define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
975 # else
976 # define _GL_ATTRIBUTE_SENTINEL(pos)
977 # endif
978 #endif
979
980 /* A helper macro. Don't use it directly. */
981 #ifndef _GL_ATTRIBUTE_UNUSED
982 # if _GL_HAS_ATTRIBUTE (unused)
983 # define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
984 # else
985 # define _GL_ATTRIBUTE_UNUSED
986 # endif
987 #endif
988
989
990 /* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
991 immediately preceding label is not used. The compiler should not warn
992 if the label is not used. */
993 /* Applies to: label (both in C and C++). */
994 /* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
995 syntax. But clang does. */
996 #ifndef _GL_UNUSED_LABEL
997 # if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
998 # define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
999 # else
1000 # define _GL_UNUSED_LABEL
1001 # endif
1002 #endif
1003
1004
1005 /* In C++, there is the concept of "language linkage", that encompasses
1006 name mangling and function calling conventions.
1007 The following macros start and end a block of "C" linkage. */
1008 #ifdef __cplusplus
1009 # define _GL_BEGIN_C_LINKAGE extern "C" {
1010 # define _GL_END_C_LINKAGE }
1011 #else
1012 # define _GL_BEGIN_C_LINKAGE
1013 # define _GL_END_C_LINKAGE
1014 #endif
1015
1016
1017 /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
1018 the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
1019 earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
1020 __APPLE__ && __MACH__ test for Mac OS X.
1021 __APPLE_CC__ tests for the Apple compiler and its version.
1022 __STDC_VERSION__ tests for the C99 mode. */
1023 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
1024 # define __GNUC_STDC_INLINE__ 1
1025 #endif
1026
1027 /* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
1028 n1 and n2 are expressions without side effects, that evaluate to real
1029 numbers (excluding NaN).
1030 It returns
1031 1 if n1 > n2
1032 0 if n1 == n2
1033 -1 if n1 < n2
1034 The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
1035 jump with nearly all GCC versions up to GCC 10.
1036 This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
1037 GCC versions up to GCC 9.
1038 The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
1039 avoids conditional jumps in all GCC versions >= 3.4. */
1040 #define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
1041
1042
1043 /* Define to `int' if <sys/types.h> does not define. */
1044 /* #undef mode_t */
1045
1046 /* Define as a signed integer type capable of holding a process identifier. */
1047 /* #undef pid_t */
1048
1049 /* Define to the equivalent of the C99 'restrict' keyword, or to
1050 nothing if this is not supported. Do not define if restrict is
1051 supported only directly. */
1052 #define restrict __restrict
1053 /* Work around a bug in older versions of Sun C++, which did not
1054 #define __restrict__ or support _Restrict or __restrict__
1055 even though the corresponding Sun C compiler ended up with
1056 "#define restrict _Restrict" or "#define restrict __restrict__"
1057 in the previous line. This workaround can be removed once
1058 we assume Oracle Developer Studio 12.5 (2016) or later. */
1059 #if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
1060 # define _Restrict
1061 # define __restrict__
1062 #endif
1063
1064 /* Define as a signed type of the same size as size_t. */
1065 /* #undef ssize_t */
1066
1067 #if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof
1068 # if HAVE_STDALIGN_H
1069 # include <stdalign.h>
1070 # endif
1071
1072 /* ISO C23 alignas and alignof for platforms that lack it.
1073
1074 References:
1075 ISO C23 (latest free draft
1076 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>)
1077 sections 6.5.3.4, 6.7.5, 7.15.
1078 C++11 (latest free draft
1079 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
1080 section 18.10. */
1081
1082 /* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
1083 requirement of a structure member (i.e., slot or field) that is of
1084 type TYPE, as an integer constant expression.
1085
1086 This differs from GCC's and clang's __alignof__ operator, which can
1087 yield a better-performing alignment for an object of that type. For
1088 example, on x86 with GCC and on Linux/x86 with clang,
1089 __alignof__ (double) and __alignof__ (long long) are 8, whereas
1090 alignof (double) and alignof (long long) are 4 unless the option
1091 '-malign-double' is used.
1092
1093 The result cannot be used as a value for an 'enum' constant, if you
1094 want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
1095
1096 /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
1097 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
1098 clang versions < 8.0.0 have the same bug. */
1099 # if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
1100 || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
1101 && !defined __clang__) \
1102 || (defined __clang__ && __clang_major__ < 8))
1103 # undef_Alignof
1104 # ifdef __cplusplus
1105 # if (201103 <= __cplusplus || defined _MSC_VER)
1106 # define _Alignof(type) alignof (type)
1107 # else
1108 template <class __t> struct __alignof_helper { char __a; __t __b; };
1109 # define _Alignof(type) offsetof (__alignof_helper<type>, __b)
1110 # define _GL_STDALIGN_NEEDS_STDDEF 1
1111 # endif
1112 # else
1113 # if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
1114 # define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
1115 # else
1116 # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
1117 # define _GL_STDALIGN_NEEDS_STDDEF 1
1118 # endif
1119 # endif
1120 # endif
1121 # if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
1122 # undefalignof
1123 # define alignof _Alignof
1124 # endif
1125
1126 /* alignas (A), also known as _Alignas (A), aligns a variable or type
1127 to the alignment A, where A is an integer constant expression. For
1128 example:
1129
1130 int alignas (8) foo;
1131 struct s { int a; int alignas (8) bar; };
1132
1133 aligns the address of FOO and the offset of BAR to be multiples of 8.
1134
1135 A should be a power of two that is at least the type's alignment
1136 and at most the implementation's alignment limit. This limit is
1137 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
1138 to MSVC through at least version 10.0, A should be an integer
1139 constant, as MSVC does not support expressions such as 1 << 3.
1140 To be portable to Sun C 5.11, do not align auto variables to
1141 anything stricter than their default alignment.
1142
1143 The following C23 requirements are not supported here:
1144
1145 - If A is zero, alignas has no effect.
1146 - alignas can be used multiple times; the strictest one wins.
1147 - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
1148
1149 */
1150 # if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
1151 # if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
1152 # define _Alignas(a) alignas (a)
1153 # elif (!defined __attribute__ \
1154 && ((defined __APPLE__ && defined __MACH__ \
1155 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
1156 : __GNUC__ && !defined __ibmxl__) \
1157 || (4 <= __clang_major__) \
1158 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
1159 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
1160 # define _Alignas(a) __attribute__ ((__aligned__ (a)))
1161 # elif 1300 <= _MSC_VER
1162 # define _Alignas(a) __declspec (align (a))
1163 # endif
1164 # endif
1165 # if !HAVE_STDALIGN_H
1166 # if ((defined _Alignas \
1167 && !(defined __cplusplus \
1168 && (201103 <= __cplusplus || defined _MSC_VER))) \
1169 || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
1170 # define alignas _Alignas
1171 # endif
1172 # endif
1173
1174 # if _GL_STDALIGN_NEEDS_STDDEF
1175 # include <stddef.h>
1176 # endif
1177 #endif
1178
1179 #if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
1180 && (!defined __cplusplus \
1181 || (__cpp_static_assert < 201411 \
1182 && __GNUG__ < 6 && __clang_major__ < 6)))
1183 #include <assert.h>
1184 #undefassert
1185 #ifdef __sgi
1186 #undef__ASSERT_H__
1187 #endif
1188 /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
1189 We need it also to be invocable with a single argument. */
1190 #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
1191 #undefstatic_assert
1192 #define static_assert _Static_assert
1193 #endif
1194 #endif