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 1 if the package shall run at any location in the file system. */
9 #define ENABLE_RELOCATABLE 1
10 
11 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
12  whether the gnulib module msvc-nothrow shall be considered present. */
13 #define GNULIB_MSVC_NOTHROW 1
14 
15 /* Define to 1 if you have the <aspell.h> header file. */
16 #define HAVE_ASPELL_H 1
17 
18 /* Define to 1 if you have the <Cocoa/Cocoa.h> header file. */
19 /* #undef HAVE_COCOA_COCOA_H */
20 
21 /* define if the compiler supports basic C++11 syntax */
22 #define HAVE_CXX11 1
23 
24 /* Define to 1 if you have the <dlfcn.h> header file. */
25 #define HAVE_DLFCN_H 1
26 
27 /* Define to 1 if you have the `fcntl' function. */
28 #define HAVE_FCNTL 1
29 
30 /* Define to 1 if you have the `flock' function. */
31 #define HAVE_FLOCK 1
32 
33 /* Define to 1 if you have the <hspell.h> header file. */
34 #define HAVE_HSPELL_H 1
35 
36 /* Define to 1 if you have the <inttypes.h> header file. */
37 #define HAVE_INTTYPES_H 1
38 
39 /* Define to 1 if you have the `applespell' library (-lapplespell). */
40 /* #undef HAVE_LIBAPPLESPELL */
41 
42 /* Define to 1 if you have the `aspell' library (-laspell). */
43 #define HAVE_LIBASPELL 1
44 
45 /* Define to 1 if you have the `hspell' library (-lhspell). */
46 #define HAVE_LIBHSPELL 1
47 
48 /* Define to 1 on MSVC platforms that have the "invalid parameter handler"
49  concept. */
50 /* #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER */
51 
52 /* Define to 1 if you have the <stdint.h> header file. */
53 #define HAVE_STDINT_H 1
54 
55 /* Define to 1 if you have the <stdio.h> header file. */
56 #define HAVE_STDIO_H 1
57 
58 /* Define to 1 if you have the <stdlib.h> header file. */
59 #define HAVE_STDLIB_H 1
60 
61 /* Define to 1 if you have the <strings.h> header file. */
62 #define HAVE_STRINGS_H 1
63 
64 /* Define to 1 if you have the <string.h> header file. */
65 #define HAVE_STRING_H 1
66 
67 /* Define to 1 if `l_type' is a member of `struct flock'. */
68 /* #undef HAVE_STRUCT_FLOCK_L_TYPE */
69 
70 /* Define to 1 if you have the <sys/file.h> header file. */
71 #define HAVE_SYS_FILE_H 1
72 
73 /* Define to 1 if you have the <sys/stat.h> header file. */
74 #define HAVE_SYS_STAT_H 1
75 
76 /* Define to 1 if you have the <sys/types.h> header file. */
77 #define HAVE_SYS_TYPES_H 1
78 
79 /* Define to 1 if you have the <unistd.h> header file. */
80 #define HAVE_UNISTD_H 1
81 
82 /* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
83 /* #undef HAVE__SET_INVALID_PARAMETER_HANDLER */
84 
85 /* Define to the value of ${prefix}, as a string. */
86 #define INSTALLPREFIX "/home/rrt/.local"
87 
88 /* Define to the extension used for runtime loadable modules, say, ".so". */
89 #define LT_MODULE_EXT ".so"
90 
91 /* Define to the sub-directory where libtool stores uninstalled libraries. */
92 #define LT_OBJDIR ".libs/"
93 
94 /* Define to the shared library suffix, say, ".dylib". */
95 /* #undef LT_SHARED_EXT */
96 
97 /* Define to the shared archive member specification, say "(shr.o)". */
98 /* #undef LT_SHARED_LIB_MEMBER */
99 
100 /* Name of package */
101 #define PACKAGE "enchant"
102 
103 /* Define to the address where bug reports for this package should be sent. */
104 #define PACKAGE_BUGREPORT ""
105 
106 /* Define to the full name of this package. */
107 #define PACKAGE_NAME "enchant"
108 
109 /* Define to the full name and version of this package. */
110 #define PACKAGE_STRING "enchant 2.7.3"
111 
112 /* Define to the one symbol short name of this package. */
113 #define PACKAGE_TARNAME "enchant"
114 
115 /* Define to the home page for this package. */
116 #define PACKAGE_URL ""
117 
118 /* Define to the version of this package. */
119 #define PACKAGE_VERSION "2.7.3"
120 
121 /* Define to 1 if all of the C90 standard headers exist (not just the ones
122  required in a freestanding environment). This macro is provided for
123  backward compatibility; new code need not use it. */
124 #define STDC_HEADERS 1
125 
126 /* Version number of package */
127 #define VERSION "2.7.3"
128 
129 /* True if the compiler says it groks GNU C version MAJOR.MINOR. */
130 #if defined __GNUC__ && defined __GNUC_MINOR__
131 # define _GL_GNUC_PREREQ(major, minor) \
132  ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
133 #else
134 # define _GL_GNUC_PREREQ(major, minor) 0
135 #endif
136 
137 
138 /* The _Noreturn keyword of C11. */
139 #ifndef _Noreturn
140 # if (defined __cplusplus \
141  && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
142  || (defined _MSC_VER && 1900 <= _MSC_VER)) \
143  && 0)
144  /* [[noreturn]] is not practically usable, because with it the syntax
145  extern _Noreturn void func (...);
146  would not be valid; such a declaration would only be valid with 'extern'
147  and '_Noreturn' swapped, or without the 'extern' keyword. However, some
148  AIX system header files and several gnulib header files use precisely
149  this syntax with 'extern'. */
150 # define _Noreturn [[noreturn]]
151 # elif (defined __clang__ && __clang_major__ < 16 \
152  && defined _GL_WORK_AROUND_LLVM_BUG_59792)
153  /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
154  that rare LLVM bug, though you may get many false-alarm warnings. */
155 # define _Noreturn
156 # elif ((!defined __cplusplus || defined __clang__) \
157  && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
158  || (!defined __STRICT_ANSI__ \
159  && (_GL_GNUC_PREREQ (4, 7) \
160  || (defined __apple_build_version__ \
161  ? 6000000 <= __apple_build_version__ \
162  : 3 < __clang_major__ + (5 <= __clang_minor__))))))
163  /* _Noreturn works as-is. */
164 # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
165 # define _Noreturn __attribute__ ((__noreturn__))
166 # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
167 # define _Noreturn __declspec (noreturn)
168 # else
169 # define _Noreturn
170 # endif
171 #endif
172 
173 
174 /* The _GL_ASYNC_SAFE marker should be attached to functions that are
175  signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
176  invoked from such signal handlers. Such functions have some restrictions:
177  * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
178  or should be listed as async-signal-safe in POSIX
179  <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
180  section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
181  particular, are NOT async-signal-safe.
182  * All memory locations (variables and struct fields) that these functions
183  access must be marked 'volatile'. This holds for both read and write
184  accesses. Otherwise the compiler might optimize away stores to and
185  reads from such locations that occur in the program, depending on its
186  data flow analysis. For example, when the program contains a loop
187  that is intended to inspect a variable set from within a signal handler
188  while (!signal_occurred)
189  ;
190  the compiler is allowed to transform this into an endless loop if the
191  variable 'signal_occurred' is not declared 'volatile'.
192  Additionally, recall that:
193  * A signal handler should not modify errno (except if it is a handler
194  for a fatal signal and ends by raising the same signal again, thus
195  provoking the termination of the process). If it invokes a function
196  that may clobber errno, it needs to save and restore the value of
197  errno. */
198 #define _GL_ASYNC_SAFE
199 
200 
201 /* Attributes. */
202 /* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if
203  <config.h> gets included once again after <sys/cdefs.h>, __has_attribute(x)
204  expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all
205  attributes. */
206 #ifndef _GL_HAS_ATTRIBUTE
207 # if (defined __has_attribute \
208  && (!defined __clang_minor__ \
209  || (defined __apple_build_version__ \
210  ? 7000000 <= __apple_build_version__ \
211  : 5 <= __clang_major__)))
212 # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
213 # else
214 # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
215 # define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
216 # define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
217 # define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
218 # define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
219 # define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
220 # define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
221 # define _GL_ATTR_diagnose_if 0
222 # define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
223 # define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
224 # define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
225 # define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
226 # define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
227 # define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
228 # ifdef _ICC
229 # define _GL_ATTR_may_alias 0
230 # else
231 # define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
232 # endif
233 # define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
234 # define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
235 # define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
236 # define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
237 # define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
238 # define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
239 # define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
240 # define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
241 # define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
242 # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
243 # endif
244 #endif
245 
246 /* Use __has_c_attribute if available. However, do not use with
247  pre-C23 GCC, which can issue false positives if -Wpedantic. */
248 #if (defined __has_c_attribute \
249  && ! (_GL_GNUC_PREREQ (4, 6) \
250  && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710))
251 # define _GL_HAVE___HAS_C_ATTRIBUTE 1
252 #else
253 # define _GL_HAVE___HAS_C_ATTRIBUTE 0
254 #endif
255 
256 /* Define if, in a function declaration, the attributes in bracket syntax
257  [[...]] must come before the attributes in __attribute__((...)) syntax.
258  If this is defined, it is best to avoid the bracket syntax, so that the
259  various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
260  order. */
261 #ifdef __cplusplus
262 # if defined __clang__
263 # define _GL_BRACKET_BEFORE_ATTRIBUTE 1
264 # endif
265 #else
266 # if defined __GNUC__ && !defined __clang__
267 # define _GL_BRACKET_BEFORE_ATTRIBUTE 1
268 # endif
269 #endif
270 
271 /* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
272  is the size of the returned memory block.
273  _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
274  by the Nth argument of the function is the size of the returned memory block.
275  */
276 /* Applies to: function, pointer to function, function types. */
277 #ifndef _GL_ATTRIBUTE_ALLOC_SIZE
278 # if _GL_HAS_ATTRIBUTE (alloc_size)
279 # define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
280 # else
281 # define _GL_ATTRIBUTE_ALLOC_SIZE(args)
282 # endif
283 #endif
284 
285 /* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
286  function and report an error if it cannot do so. */
287 /* Applies to: function. */
288 #ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
289 # if _GL_HAS_ATTRIBUTE (always_inline)
290 # define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
291 # else
292 # define _GL_ATTRIBUTE_ALWAYS_INLINE
293 # endif
294 #endif
295 
296 /* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
297  in stack traces when debugging. The compiler should omit the function from
298  stack traces. */
299 /* Applies to: function. */
300 #ifndef _GL_ATTRIBUTE_ARTIFICIAL
301 # if _GL_HAS_ATTRIBUTE (artificial)
302 # define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
303 # else
304 # define _GL_ATTRIBUTE_ARTIFICIAL
305 # endif
306 #endif
307 
308 /* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
309 /* Applies to: functions. */
310 /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
311  <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
312  Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
313 #ifndef _GL_ATTRIBUTE_COLD
314 # if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
315 # ifndef __SUNPRO_C
316 # define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
317 # else
318 # define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
319 # endif
320 # else
321 # define _GL_ATTRIBUTE_COLD
322 # endif
323 #endif
324 
325 /* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
326  calls to the function with the same arguments.
327  This attribute is safe for a function that neither depends on nor affects
328  observable state, and always returns exactly once - e.g., does not loop
329  forever, and does not call longjmp.
330  (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
331 /* Applies to: functions. */
332 #ifndef _GL_ATTRIBUTE_CONST
333 # if _GL_HAS_ATTRIBUTE (const)
334 # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
335 # else
336 # define _GL_ATTRIBUTE_CONST
337 # endif
338 #endif
339 
340 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
341  that can be freed by passing them as the Ith argument to the
342  function F.
343  _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
344  can be freed via 'free'; it can be used only after declaring 'free'. */
345 /* Applies to: functions. Cannot be used on inline functions. */
346 #ifndef _GL_ATTRIBUTE_DEALLOC
347 # if _GL_GNUC_PREREQ (11, 0)
348 # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
349 # else
350 # define _GL_ATTRIBUTE_DEALLOC(f, i)
351 # endif
352 #endif
353 /* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
354  to use this earlier definition, since <stdlib.h> may not have been included
355  yet. */
356 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
357 # if defined __cplusplus && defined __GNUC__ && !defined __clang__
358 /* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
359 # define _GL_ATTRIBUTE_DEALLOC_FREE \
360  _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
361 # else
362 # define _GL_ATTRIBUTE_DEALLOC_FREE \
363  _GL_ATTRIBUTE_DEALLOC (free, 1)
364 # endif
365 #endif
366 
367 /* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
368  The compiler may warn if the entity is used. */
369 /* Applies to:
370  - function, variable,
371  - struct, union, struct/union member,
372  - enumeration, enumeration item,
373  - typedef,
374  in C++ also: namespace, class, template specialization. */
375 #ifndef _GL_ATTRIBUTE_DEPRECATED
376 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
377 # if _GL_HAVE___HAS_C_ATTRIBUTE
378 # if __has_c_attribute (__deprecated__)
379 # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
380 # endif
381 # endif
382 # endif
383 # if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
384 # define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
385 # endif
386 # ifndef _GL_ATTRIBUTE_DEPRECATED
387 # define _GL_ATTRIBUTE_DEPRECATED
388 # endif
389 #endif
390 
391 /* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
392  the function call is not optimized away.
393  _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
394  the function call is not optimized away. */
395 /* Applies to: functions. */
396 #if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
397 # if _GL_HAS_ATTRIBUTE (error)
398 # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
399 # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
400 # elif _GL_HAS_ATTRIBUTE (diagnose_if)
401 # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
402 # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
403 # else
404 # define _GL_ATTRIBUTE_ERROR(msg)
405 # define _GL_ATTRIBUTE_WARNING(msg)
406 # endif
407 #endif
408 
409 /* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
410  visible to debuggers etc., even with '-fwhole-program'. */
411 /* Applies to: functions, variables. */
412 #ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
413 # if _GL_HAS_ATTRIBUTE (externally_visible)
414 # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
415 # else
416 # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
417 # endif
418 #endif
419 
420 /* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
421  the control flow falls through to the immediately following 'case' or
422  'default' label. The compiler should not warn in this case. */
423 /* Applies to: Empty statement (;), inside a 'switch' statement. */
424 /* Always expands to something. */
425 #ifndef _GL_ATTRIBUTE_FALLTHROUGH
426 # if _GL_HAVE___HAS_C_ATTRIBUTE
427 # if __has_c_attribute (__fallthrough__)
428 # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
429 # endif
430 # endif
431 # if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough)
432 # define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
433 # endif
434 # ifndef _GL_ATTRIBUTE_FALLTHROUGH
435 # define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
436 # endif
437 #endif
438 
439 /* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
440  declares that the STRING-INDEXth function argument is a format string of
441  style ARCHETYPE, which is one of:
442  printf, gnu_printf
443  scanf, gnu_scanf,
444  strftime, gnu_strftime,
445  strfmon,
446  or the same thing prefixed and suffixed with '__'.
447  If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
448  are suitable for the format string. */
449 /* Applies to: functions. */
450 #ifndef _GL_ATTRIBUTE_FORMAT
451 # if _GL_HAS_ATTRIBUTE (format)
452 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
453 # else
454 # define _GL_ATTRIBUTE_FORMAT(spec)
455 # endif
456 #endif
457 
458 /* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
459  compilation unit, it executes code from that unit only by return or by
460  exception handling. This declaration lets the compiler optimize that unit
461  more aggressively. */
462 /* Applies to: functions. */
463 #ifndef _GL_ATTRIBUTE_LEAF
464 # if _GL_HAS_ATTRIBUTE (leaf)
465 # define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
466 # else
467 # define _GL_ATTRIBUTE_LEAF
468 # endif
469 #endif
470 
471 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
472  allocated memory. */
473 /* Applies to: functions. */
474 #ifndef _GL_ATTRIBUTE_MALLOC
475 # if _GL_HAS_ATTRIBUTE (malloc)
476 # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
477 # else
478 # define _GL_ATTRIBUTE_MALLOC
479 # endif
480 #endif
481 
482 /* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
483  same storage as pointers to other types. Thus this declaration disables
484  strict aliasing optimization. */
485 /* Applies to: types. */
486 /* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
487 #ifndef _GL_ATTRIBUTE_MAY_ALIAS
488 # if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
489 # define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
490 # else
491 # define _GL_ATTRIBUTE_MAY_ALIAS
492 # endif
493 #endif
494 
495 /* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
496  the entity is not used. The compiler should not warn if the entity is not
497  used. */
498 /* Applies to:
499  - function, variable,
500  - struct, union, struct/union member,
501  - enumeration, enumeration item,
502  - typedef,
503  in C++ also: class. */
504 /* In C++ and C23, this is spelled [[__maybe_unused__]].
505  GCC's syntax is __attribute__ ((__unused__)).
506  clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
507  __has_c_attribute (__maybe_unused__) yields true but the use of
508  [[__maybe_unused__]] nevertheless produces a warning. */
509 #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
510 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
511 # if defined __clang__ && defined __cplusplus
512 # if !defined __apple_build_version__ && __clang_major__ >= 10
513 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
514 # endif
515 # elif _GL_HAVE___HAS_C_ATTRIBUTE
516 # if __has_c_attribute (__maybe_unused__)
517 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
518 # endif
519 # endif
520 # endif
521 # ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
522 # define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
523 # endif
524 #endif
525 /* Alternative spelling of this macro, for convenience and for
526  compatibility with glibc/include/libc-symbols.h. */
527 #define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
528 /* Earlier spellings of this macro. */
529 #define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
530 
531 /* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
532  discard the return value. The compiler may warn if the caller does not use
533  the return value, unless the caller uses something like ignore_value. */
534 /* Applies to: function, enumeration, class. */
535 #ifndef _GL_ATTRIBUTE_NODISCARD
536 # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
537 # if defined __clang__ && defined __cplusplus
538  /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
539  a warning.
540  The 1000 below means a yet unknown threshold. When clang++ version X
541  starts supporting [[__nodiscard__]] without warning about it, you can
542  replace the 1000 with X. */
543 # if __clang_major__ >= 1000
544 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
545 # endif
546 # elif _GL_HAVE___HAS_C_ATTRIBUTE
547 # if __has_c_attribute (__nodiscard__)
548 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
549 # endif
550 # endif
551 # endif
552 # if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
553 # define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
554 # endif
555 # ifndef _GL_ATTRIBUTE_NODISCARD
556 # define _GL_ATTRIBUTE_NODISCARD
557 # endif
558 #endif
559 
560 /* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
561  function. */
562 /* Applies to: functions. */
563 #ifndef _GL_ATTRIBUTE_NOINLINE
564 # if _GL_HAS_ATTRIBUTE (noinline)
565 # define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
566 # else
567 # define _GL_ATTRIBUTE_NOINLINE
568 # endif
569 #endif
570 
571 /* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
572  must not be NULL.
573  _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
574  null. */
575 /* Applies to: functions. */
576 #ifndef _GL_ATTRIBUTE_NONNULL
577 # if _GL_HAS_ATTRIBUTE (nonnull)
578 # define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
579 # else
580 # define _GL_ATTRIBUTE_NONNULL(args)
581 # endif
582 #endif
583 
584 /* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
585  not meant to be NUL-terminated. */
586 /* Applies to: struct/union members and variables that are arrays of element
587  type '[[un]signed] char'. */
588 #ifndef _GL_ATTRIBUTE_NONSTRING
589 # if _GL_HAS_ATTRIBUTE (nonstring)
590 # define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
591 # else
592 # define _GL_ATTRIBUTE_NONSTRING
593 # endif
594 #endif
595 
596 /* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
597 
598 /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
599  */
600 /* Applies to: functions. */
601 /* After a function's parameter list, this attribute must come first, before
602  other attributes. */
603 #ifndef _GL_ATTRIBUTE_NOTHROW
604 # if defined __cplusplus
605 # if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4
606 # if __cplusplus >= 201103L
607 # define _GL_ATTRIBUTE_NOTHROW noexcept (true)
608 # else
609 # define _GL_ATTRIBUTE_NOTHROW throw ()
610 # endif
611 # else
612 # define _GL_ATTRIBUTE_NOTHROW
613 # endif
614 # else
615 # if _GL_HAS_ATTRIBUTE (nothrow)
616 # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
617 # else
618 # define _GL_ATTRIBUTE_NOTHROW
619 # endif
620 # endif
621 #endif
622 
623 /* _GL_ATTRIBUTE_PACKED declares:
624  For struct members: The member has the smallest possible alignment.
625  For struct, union, class: All members have the smallest possible alignment,
626  minimizing the memory required. */
627 /* Applies to: struct members, struct, union,
628  in C++ also: class. */
629 /* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite
630  __has_attribute OK. */
631 #ifndef _GL_ATTRIBUTE_PACKED
632 # if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C
633 # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
634 # else
635 # define _GL_ATTRIBUTE_PACKED
636 # endif
637 #endif
638 
639 /* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
640  calls to the function with the same arguments if observable state is not
641  changed between calls.
642  This attribute is safe for a function that does not affect
643  observable state, and always returns exactly once.
644  (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
645 /* Applies to: functions. */
646 #ifndef _GL_ATTRIBUTE_PURE
647 # if _GL_HAS_ATTRIBUTE (pure)
648 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
649 # else
650 # define _GL_ATTRIBUTE_PURE
651 # endif
652 #endif
653 
654 /* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
655  a non-NULL pointer. */
656 /* Applies to: functions. */
657 #ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
658 # if _GL_HAS_ATTRIBUTE (returns_nonnull)
659 # define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
660 # else
661 # define _GL_ATTRIBUTE_RETURNS_NONNULL
662 # endif
663 #endif
664 
665 /* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
666  trailing NULL argument.
667  _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
668  _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
669 /* Applies to: functions. */
670 #ifndef _GL_ATTRIBUTE_SENTINEL
671 # if _GL_HAS_ATTRIBUTE (sentinel)
672 # define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
673 # else
674 # define _GL_ATTRIBUTE_SENTINEL(pos)
675 # endif
676 #endif
677 
678 /* A helper macro. Don't use it directly. */
679 #ifndef _GL_ATTRIBUTE_UNUSED
680 # if _GL_HAS_ATTRIBUTE (unused)
681 # define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
682 # else
683 # define _GL_ATTRIBUTE_UNUSED
684 # endif
685 #endif
686 
687 
688 /* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
689  immediately preceding label is not used. The compiler should not warn
690  if the label is not used. */
691 /* Applies to: label (both in C and C++). */
692 /* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
693  syntax. But clang does. */
694 #ifndef _GL_UNUSED_LABEL
695 # if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
696 # define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
697 # else
698 # define _GL_UNUSED_LABEL
699 # endif
700 #endif
701 
702 
703 /* In C++, there is the concept of "language linkage", that encompasses
704  name mangling and function calling conventions.
705  The following macros start and end a block of "C" linkage. */
706 #ifdef __cplusplus
707 # define _GL_BEGIN_C_LINKAGE extern "C" {
708 # define _GL_END_C_LINKAGE }
709 #else
710 # define _GL_BEGIN_C_LINKAGE
711 # define _GL_END_C_LINKAGE
712 #endif
713 
714 
715 /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
716  the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
717  earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
718  __APPLE__ && __MACH__ test for Mac OS X.
719  __APPLE_CC__ tests for the Apple compiler and its version.
720  __STDC_VERSION__ tests for the C99 mode. */
721 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
722 # define __GNUC_STDC_INLINE__ 1
723 #endif
724 
725 /* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
726  n1 and n2 are expressions without side effects, that evaluate to real
727  numbers (excluding NaN).
728  It returns
729  1 if n1 > n2
730  0 if n1 == n2
731  -1 if n1 < n2
732  The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
733  jump with nearly all GCC versions up to GCC 10.
734  This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
735  GCC versions up to GCC 9.
736  The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
737  avoids conditional jumps in all GCC versions >= 3.4. */
738 #define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
739