백준 (비교)

r3 ➤ r4
26
27==문제 예시==
28===1000번===
29가장 첫번째 문제인 1000번(브론즈 V)은 매우 어려운 문제 중 하나이다. [[https://www.acmicpc.net/problem/1000|#]]
30
31> '''문제'''
32> 두 정수 A와 B를 입력받은 다음,[br]A+B를 출력하는 프로그램을 작성하시오.
33>
34> '''입력'''
35> 첫째 줄에 A와 B가 주어진다. (0 < A, B < 10)
36>
37> '''출력'''
38> 첫째 줄에 A+B를 출력한다.
39>
40> '''예제 입력 1''' '''예제 출력 1'''
41> 1 2 3
42>
43>
44====#해답#====
45C++ 기준으로 작성된 코드이다.
46
47{{{#!syntax cpp
48 #ifndef _STDIO_H_
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 #define _STDIO_H_
53
54 #define _FSTDIO /* ``function stdio'' */
55
56 #define __need_size_t
57
58#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
59 && !defined(__STDDEF_H__)) \
60 || defined(__need_wchar_t) || defined(__need_size_t) \
61 || defined(__need_ptrdiff_t) || defined(__need_NULL) \
62 || defined(__need_wint_t)
63
64
65#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
66 && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
67 && !defined(__need_wint_t))
68#define _STDDEF_H
69#define _STDDEF_H_
70#define _ANSI_STDDEF_H
71#endif
72
73#ifndef __sys_stdtypes_h
74
75#if defined(__NetBSD__)
76#endif
77
78#if defined (__FreeBSD__)
79
80
81#ifndef _SYS__TYPES_H_
82#define _SYS__TYPES_H_
83
84
85typedef __int64_t __blkcnt_t; /* blocks allocated for file */
86typedef __int32_t __blksize_t; /* optimal blocksize for I/O */
87typedef __int64_t __clock_t; /* ticks in CLOCKS_PER_SEC */
88typedef __int32_t __clockid_t; /* CLOCK_* identifiers */
89typedef unsigned long __cpuid_t; /* CPU id */
90typedef __int32_t __dev_t; /* device number */
91typedef __uint32_t __fixpt_t; /* fixed point number */
92typedef __uint64_t __fsblkcnt_t; /* file system block count */
93typedef __uint64_t __fsfilcnt_t; /* file system file count */
94typedef __uint32_t __gid_t; /* group id */
95typedef __uint32_t __id_t; /* may contain pid, uid or gid */
96typedef __uint32_t __in_addr_t; /* base type for internet address */
97typedef __uint16_t __in_port_t; /* IP port type */
98typedef __uint64_t __ino_t; /* inode number */
99typedef long __key_t; /* IPC key (for Sys V IPC) */
100typedef __uint32_t __mode_t; /* permissions */
101typedef __uint32_t __nlink_t; /* link count */
102typedef __int64_t __off_t; /* file offset or size */
103typedef __int32_t __pid_t; /* process id */
104typedef __uint64_t __rlim_t; /* resource limit */
105typedef __uint8_t __sa_family_t; /* sockaddr address family type */
106typedef __int32_t __segsz_t; /* segment size */
107typedef __uint32_t __socklen_t; /* length type for network syscalls */
108typedef long __suseconds_t; /* microseconds (signed) */
109typedef __int64_t __time_t; /* epoch time */
110typedef __int32_t __timer_t; /* POSIX timer identifiers */
111typedef __uint32_t __uid_t; /* user id */
112typedef __uint32_t __useconds_t; /* microseconds */
113
114/*
115 * mbstate_t is an opaque object to keep conversion state, during multibyte
116 * stream conversions. The content must not be referenced by user programs.
117 */
118typedef union {
119 char __mbstate8[128];
120 __int64_t __mbstateL; /* for alignment */
121} __mbstate_t;
122
123#endif /* !_SYS__TYPES_H_ */
124#endif
125
126#if defined(__NetBSD__)
127#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
128#define _SIZE_T
129#endif
130#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
131#define _PTRDIFF_T
132#endif
133/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
134 instead of _WCHAR_T_. */
135#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
136#ifndef _BSD_WCHAR_T_
137#define _WCHAR_T
138#endif
139#endif
140/* Undef _FOO_T_ if we are supposed to define foo_t. */
141#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
142#undef _PTRDIFF_T_
143#undef _BSD_PTRDIFF_T_
144#endif
145#if defined (__need_size_t) || defined (_STDDEF_H_)
146#undef _SIZE_T_
147#undef _BSD_SIZE_T_
148#endif
149#if defined (__need_wchar_t) || defined (_STDDEF_H_)
150#undef _WCHAR_T_
151#undef _BSD_WCHAR_T_
152#endif
153#endif /* defined(__NetBSD__) */
154
155/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
156 Just ignore it. */
157#if defined (__sequent__) && defined (_PTRDIFF_T_)
158#undef _PTRDIFF_T_
159#endif
160
161/* When modular code is enabled with macOS SDKs from version 15, the
162 include guards are set in the includers of this code, rather than as
163 part of it. This means the we must unset them or the intended code
164 here will be bypassed (resulting in undefined values). */
165#if defined (__APPLE__)
166# if defined(__has_feature) && __has_feature(modules)
167# if defined (__need_ptrdiff_t)
168# undef __PTRDIFF_T
169# endif
170# if defined (__need_size_t)
171# undef __SIZE_T
172# endif
173# endif
174#endif
175
176/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
177 _TYPE_size_t which will typedef size_t. fixincludes patched the
178 vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
179 not defined, and so that defining this macro defines _GCC_SIZE_T.
180 If we find that the macros are still defined at this point, we must
181 invoke them so that the type is defined as expected. */
182#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
183_TYPE_ptrdiff_t;
184#undef _TYPE_ptrdiff_t
185#endif
186#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
187_TYPE_size_t;
188#undef _TYPE_size_t
189#endif
190#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
191_TYPE_wchar_t;
192#undef _TYPE_wchar_t
193#endif
194
195/* In case nobody has defined these types, but we aren't running under
196 GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
197 __WCHAR_TYPE__ have reasonable values. This can happen if the
198 parts of GCC is compiled by an older compiler, that actually
199 include gstddef.h, such as collect2. */
200
201/* Signed type of difference of two pointers. */
202
203/* Define this type if we are doing the whole job,
204 or if we want this type in particular. */
205#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
206#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
207#ifndef _T_PTRDIFF_
208#ifndef _T_PTRDIFF
209#ifndef __PTRDIFF_T
210#ifndef _PTRDIFF_T_
211#ifndef _BSD_PTRDIFF_T_
212#ifndef ___int_ptrdiff_t_h
213#ifndef _GCC_PTRDIFF_T
214#ifndef _PTRDIFF_T_DECLARED /* DragonFly */
215#ifndef __DEFINED_ptrdiff_t /* musl libc */
216#define _PTRDIFF_T
217#define _T_PTRDIFF_
218#define _T_PTRDIFF
219#define __PTRDIFF_T
220#define _PTRDIFF_T_
221#define _BSD_PTRDIFF_T_
222#define ___int_ptrdiff_t_h
223#define _GCC_PTRDIFF_T
224#define _PTRDIFF_T_DECLARED
225#define __DEFINED_ptrdiff_t
226#ifndef __PTRDIFF_TYPE__
227#define __PTRDIFF_TYPE__ long int
228#endif
229typedef __PTRDIFF_TYPE__ ptrdiff_t;
230#endif /* __DEFINED_ptrdiff_t */
231#endif /* _PTRDIFF_T_DECLARED */
232#endif /* _GCC_PTRDIFF_T */
233#endif /* ___int_ptrdiff_t_h */
234#endif /* _BSD_PTRDIFF_T_ */
235#endif /* _PTRDIFF_T_ */
236#endif /* __PTRDIFF_T */
237#endif /* _T_PTRDIFF */
238#endif /* _T_PTRDIFF_ */
239#endif /* _PTRDIFF_T */
240
241/* If this symbol has done its job, get rid of it. */
242#undef __need_ptrdiff_t
243
244#endif /* _STDDEF_H or __need_ptrdiff_t. */
245
246/* Unsigned type of `sizeof' something. */
247
248/* Define this type if we are doing the whole job,
249 or if we want this type in particular. */
250#if defined (_STDDEF_H) || defined (__need_size_t)
251#ifndef __size_t__ /* BeOS */
252#ifndef __SIZE_T__ /* Cray Unicos/Mk */
253#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
254#ifndef _SYS_SIZE_T_H
255#ifndef _T_SIZE_
256#ifndef _T_SIZE
257#ifndef __SIZE_T
258#ifndef _SIZE_T_
259#ifndef _BSD_SIZE_T_
260#ifndef _SIZE_T_DEFINED_
261#ifndef _SIZE_T_DEFINED
262#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
263#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
264#ifndef __DEFINED_size_t /* musl libc */
265#ifndef ___int_size_t_h
266#ifndef _GCC_SIZE_T
267#ifndef _SIZET_
268#ifndef __size_t
269#define __size_t__ /* BeOS */
270#define __SIZE_T__ /* Cray Unicos/Mk */
271#define _SIZE_T
272#define _SYS_SIZE_T_H
273#define _T_SIZE_
274#define _T_SIZE
275#define __SIZE_T
276#define _SIZE_T_
277#define _BSD_SIZE_T_
278#define _SIZE_T_DEFINED_
279#define _SIZE_T_DEFINED
280#define _BSD_SIZE_T_DEFINED_ /* Darwin */
281#define _SIZE_T_DECLARED /* FreeBSD 5 */
282#define __DEFINED_size_t /* musl libc */
283#define ___int_size_t_h
284#define _GCC_SIZE_T
285#define _SIZET_
286#if defined (__FreeBSD__) \
287 || defined(__DragonFly__) \
288 || defined(__FreeBSD_kernel__) \
289 || defined(__VMS__)
290/* __size_t is a typedef, must not trash it. */
291#else
292#define __size_t
293#endif
294#ifndef __SIZE_TYPE__
295#define __SIZE_TYPE__ long unsigned int
296#endif
297#if !(defined (__GNUG__) && defined (size_t))
298typedef __SIZE_TYPE__ size_t;
299#ifdef __BEOS__
300typedef long ssize_t;
301#endif /* __BEOS__ */
302#endif /* !(defined (__GNUG__) && defined (size_t)) */
303#endif /* __size_t */
304#endif /* _SIZET_ */
305#endif /* _GCC_SIZE_T */
306#endif /* ___int_size_t_h */
307#endif /* __DEFINED_size_t */
308#endif /* _SIZE_T_DECLARED */
309#endif /* _BSD_SIZE_T_DEFINED_ */
310#endif /* _SIZE_T_DEFINED */
311#endif /* _SIZE_T_DEFINED_ */
312#endif /* _BSD_SIZE_T_ */
313#endif /* _SIZE_T_ */
314#endif /* __SIZE_T */
315#endif /* _T_SIZE */
316#endif /* _T_SIZE_ */
317#endif /* _SYS_SIZE_T_H */
318#endif /* _SIZE_T */
319#endif /* __SIZE_T__ */
320#endif /* __size_t__ */
321#undef __need_size_t
322#endif /* _STDDEF_H or __need_size_t. */
323
324
325/* Wide character type.
326 Locale-writers should change this as necessary to
327 be big enough to hold unique values not between 0 and 127,
328 and not (wchar_t) -1, for each defined multibyte character. */
329
330/* Define this type if we are doing the whole job,
331 or if we want this type in particular. */
332#if defined (_STDDEF_H) || defined (__need_wchar_t)
333#ifndef __wchar_t__ /* BeOS */
334#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
335#ifndef _WCHAR_T
336#ifndef _T_WCHAR_
337#ifndef _T_WCHAR
338#ifndef __WCHAR_T
339#ifndef _WCHAR_T_
340#ifndef _BSD_WCHAR_T_
341#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
342#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
343#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
344#ifndef __DEFINED_wchar_t /* musl libc */
345#ifndef _WCHAR_T_DEFINED_
346#ifndef _WCHAR_T_DEFINED
347#ifndef _WCHAR_T_H
348#ifndef ___int_wchar_t_h
349#ifndef __INT_WCHAR_T_H
350#ifndef _GCC_WCHAR_T
351#define __wchar_t__ /* BeOS */
352#define __WCHAR_T__ /* Cray Unicos/Mk */
353#define _WCHAR_T
354#define _T_WCHAR_
355#define _T_WCHAR
356#define __WCHAR_T
357#define _WCHAR_T_
358#define _BSD_WCHAR_T_
359#define _WCHAR_T_DEFINED_
360#define _WCHAR_T_DEFINED
361#define _WCHAR_T_H
362#define ___int_wchar_t_h
363#define __INT_WCHAR_T_H
364#define _GCC_WCHAR_T
365#define _WCHAR_T_DECLARED
366#define __DEFINED_wchar_t
367
368/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
369 instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
370 symbols in the _FOO_T_ family, stays defined even after its
371 corresponding type is defined). If we define wchar_t, then we
372 must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
373 we undef _WCHAR_T_, then we must also define rune_t, since
374 headers like runetype.h assume that if machine/ansi.h is included,
375 and _BSD_WCHAR_T_ is not defined, then rune_t is available.
376 machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
377 the same type." */
378#ifdef _BSD_WCHAR_T_
379#undef _BSD_WCHAR_T_
380#ifdef _BSD_RUNE_T_
381#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
382typedef _BSD_RUNE_T_ rune_t;
383#define _BSD_WCHAR_T_DEFINED_
384#define _BSD_RUNE_T_DEFINED_ /* Darwin */
385#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
386/* Why is this file so hard to maintain properly? In contrast to
387 the comment above regarding BSD/386 1.1, on FreeBSD for as long
388 as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
389 redundant typedefs will occur when stdlib.h is included after this file. */
390#undef _BSD_RUNE_T_
391#endif
392#endif
393#endif
394#endif
395/* FreeBSD 5 can't be handled well using "traditional" logic above
396 since it no longer defines _BSD_RUNE_T_ yet still desires to export
397 rune_t in some cases... */
398#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
399#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
400#if __BSD_VISIBLE
401#ifndef _RUNE_T_DECLARED
402typedef __rune_t rune_t;
403#define _RUNE_T_DECLARED
404#endif
405#endif
406#endif
407#endif
408
409#ifndef __WCHAR_TYPE__
410#define __WCHAR_TYPE__ int
411#endif
412#ifndef __cplusplus
413typedef __WCHAR_TYPE__ wchar_t;
414#endif
415#endif
416#endif
417#endif
418#endif
419#endif
420#endif
421#endif /* __DEFINED_wchar_t */
422#endif /* _WCHAR_T_DECLARED */
423#endif /* _BSD_RUNE_T_DEFINED_ */
424#endif
425#endif
426#endif
427#endif
428#endif
429#endif
430#endif
431#endif /* __WCHAR_T__ */
432#endif /* __wchar_t__ */
433#undef __need_wchar_t
434#endif /* _STDDEF_H or __need_wchar_t. */
435
436#if defined (__need_wint_t)
437#ifndef _WINT_T
438#define _WINT_T
439
440#ifndef __WINT_TYPE__
441#define __WINT_TYPE__ unsigned int
442#endif
443typedef __WINT_TYPE__ wint_t;
444#endif
445#undef __need_wint_t
446#endif
447
448#if defined(__NetBSD__)
449/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
450 are probably typos and should be removed before 2.8 is released. */
451#ifdef _GCC_PTRDIFF_T_
452#undef _PTRDIFF_T_
453#undef _BSD_PTRDIFF_T_
454#endif
455#ifdef _GCC_SIZE_T_
456#undef _SIZE_T_
457#undef _BSD_SIZE_T_
458#endif
459#ifdef _GCC_WCHAR_T_
460#undef _WCHAR_T_
461#undef _BSD_WCHAR_T_
462#endif
463/* The following ones are the real ones. */
464#ifdef _GCC_PTRDIFF_T
465#undef _PTRDIFF_T_
466#undef _BSD_PTRDIFF_T_
467#endif
468#ifdef _GCC_SIZE_T
469#undef _SIZE_T_
470#undef _BSD_SIZE_T_
471#endif
472#ifdef _GCC_WCHAR_T
473#undef _WCHAR_T_
474#undef _BSD_WCHAR_T_
475#endif
476#endif /* __NetBSD__ */
477
478#endif /* __sys_stdtypes_h */
479
480/* A null pointer constant. */
481
482#if defined (_STDDEF_H) || defined (__need_NULL)
483#undef NULL /* in case <stdio.h> has defined it. */
484#ifdef __GNUG__
485#define NULL __null
486#else /* G++ */
487#ifndef __cplusplus
488#define NULL ((void *)0)
489#else /* C++ */
490#define NULL 0
491#endif /* C++ */
492#endif /* G++ */
493#endif /* NULL not defined and <stddef.h> or need NULL. */
494#undef __need_NULL
495
496#ifdef _STDDEF_H
497
498/* Offset of member MEMBER in a struct of type TYPE. */
499#undef offsetof /* in case a system header has defined it. */
500#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
501
502#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
503 || (defined(__cplusplus) && __cplusplus >= 201103L)
504#ifndef _GCC_MAX_ALIGN_T
505#define _GCC_MAX_ALIGN_T
506/* Type whose alignment is supported in every context and is at least
507 as great as that of any standard type not using alignment
508 specifiers. */
509typedef struct {
510 long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
511 long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
512 /* _Float128 is defined as a basic type, so max_align_t must be
513 sufficiently aligned for it. This code must work in C++, so we
514 use __float128 here; that is only available on some
515 architectures, but only on i386 is extra alignment needed for
516 __float128. */
517#ifdef __i386__
518 __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128))));
519#endif
520} max_align_t;
521#endif
522#endif /* C11 or C++11. */
523
524#if defined(__cplusplus) && __cplusplus >= 201103L
525#ifndef _GXX_NULLPTR_T
526#define _GXX_NULLPTR_T
527 typedef decltype(nullptr) nullptr_t;
528#endif
529#endif /* C++11. */
530
531#if defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L
532#ifndef _GCC_NULLPTR_T
533#define _GCC_NULLPTR_T
534 typedef __typeof__(nullptr) nullptr_t;
535#endif
536#ifndef __STDC_VERSION_STDDEF_H__
537#define unreachable() (__builtin_unreachable ())
538#define __STDC_VERSION_STDDEF_H__ 202311L
539#endif
540#endif /* C23. */
541
542#endif /* _STDDEF_H was defined this time */
543
544#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
545 || __need_XXX was not defined before */
546
547 #define __need___va_list
548// TR1 stdarg.h -*- C++ -*-
549
550// Copyright (C) 2006-2025 Free Software Foundation, Inc.
551//
552// This file is part of the GNU ISO C++ Library. This library is free
553// software; you can redistribute it and/or modify it under the
554// terms of the GNU General Public License as published by the
555// Free Software Foundation; either version 3, or (at your option)
556// any later version.
557
558// This library is distributed in the hope that it will be useful,
559// but WITHOUT ANY WARRANTY; without even the implied warranty of
560// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
561// GNU General Public License for more details.
562
563// Under Section 7 of GPL version 3, you are granted additional
564// permissions described in the GCC Runtime Library Exception, version
565// 3.1, as published by the Free Software Foundation.
566
567// You should have received a copy of the GNU General Public License and
568// a copy of the GCC Runtime Library Exception along with this program;
569// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
570// <http://www.gnu.org/licenses/>.
571
572/** @file tr1/stdarg.h
573 * This is a TR1 C++ Library header.
574 */
575
576#ifndef _TR1_STDARG_H
577#define _TR1_STDARG_H 1
578
579// Predefined symbols and macros -*- C++ -*-
580
581// Copyright (C) 1997-2025 Free Software Foundation, Inc.
582//
583// This file is part of the GNU ISO C++ Library. This library is free
584// software; you can redistribute it and/or modify it under the
585// terms of the GNU General Public License as published by the
586// Free Software Foundation; either version 3, or (at your option)
587// any later version.
588
589// This library is distributed in the hope that it will be useful,
590// but WITHOUT ANY WARRANTY; without even the implied warranty of
591// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
592// GNU General Public License for more details.
593
594// Under Section 7 of GPL version 3, you are granted additional
595// permissions described in the GCC Runtime Library Exception, version
596// 3.1, as published by the Free Software Foundation.
597
598// You should have received a copy of the GNU General Public License and
599// a copy of the GCC Runtime Library Exception along with this program;
600// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
601// <http://www.gnu.org/licenses/>.
602
603/** @file bits/c++config.h
604 * This is an internal header file, included by other library headers.
605 * Do not attempt to use it directly. @headername{version}
606 */
607
608#ifndef _GLIBCXX_CXX_CONFIG_H
609#define _GLIBCXX_CXX_CONFIG_H 1
610
611#ifdef _GLIBCXX_SYSHDR
612#pragma GCC system_header
613#endif
614
615#pragma GCC diagnostic push
616#pragma GCC diagnostic ignored "-Wvariadic-macros"
617#if __cplusplus
618#endif
619
620// The major release number for the GCC release the C++ library belongs to.
621#define _GLIBCXX_RELEASE
622
623// The datestamp of the C++ library in compressed ISO date format.
624#undef __GLIBCXX__ /* The testsuite defines it to 99999999 to block PCH. */
625#define __GLIBCXX__
626
627// Macros for various attributes.
628// _GLIBCXX_PURE
629// _GLIBCXX_CONST
630// _GLIBCXX_NORETURN
631// _GLIBCXX_NOTHROW
632// _GLIBCXX_VISIBILITY
633#ifndef _GLIBCXX_PURE
634# define _GLIBCXX_PURE __attribute__ ((__pure__))
635#endif
636
637#ifndef _GLIBCXX_CONST
638# define _GLIBCXX_CONST __attribute__ ((__const__))
639#endif
640
641#ifndef _GLIBCXX_NORETURN
642# define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
643#endif
644
645// See below for C++
646#ifndef _GLIBCXX_NOTHROW
647# ifndef __cplusplus
648# define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
649# endif
650#endif
651
652// Macros for visibility attributes.
653// _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
654// _GLIBCXX_VISIBILITY
655#define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
656
657# define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
658#else
659// If this is not supplied by the OS-specific or CPU-specific
660// headers included below, it will be defined to an empty default.
661# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
662#endif
663
664// Macros for deprecated attributes.
665// _GLIBCXX_USE_DEPRECATED
666// _GLIBCXX_DEPRECATED
667// _GLIBCXX_DEPRECATED_SUGGEST( string-literal )
668// _GLIBCXX11_DEPRECATED
669// _GLIBCXX11_DEPRECATED_SUGGEST( string-literal )
670// _GLIBCXX14_DEPRECATED
671// _GLIBCXX14_DEPRECATED_SUGGEST( string-literal )
672// _GLIBCXX17_DEPRECATED
673// _GLIBCXX17_DEPRECATED_SUGGEST( string-literal )
674// _GLIBCXX20_DEPRECATED
675// _GLIBCXX20_DEPRECATED_SUGGEST( string-literal )
676// _GLIBCXX23_DEPRECATED
677// _GLIBCXX23_DEPRECATED_SUGGEST( string-literal )
678// _GLIBCXX26_DEPRECATED
679// _GLIBCXX26_DEPRECATED_SUGGEST( string-literal )
680#ifndef _GLIBCXX_USE_DEPRECATED
681# define _GLIBCXX_USE_DEPRECATED 1
682#endif
683
684#if defined(__DEPRECATED)
685# define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
686# define _GLIBCXX_DEPRECATED_SUGGEST(ALT) \
687 __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
688#else
689# define _GLIBCXX_DEPRECATED
690# define _GLIBCXX_DEPRECATED_SUGGEST(ALT)
691#endif
692
693#if defined(__DEPRECATED) && (__cplusplus >= 201103L)
694# define _GLIBCXX11_DEPRECATED _GLIBCXX_DEPRECATED
695# define _GLIBCXX11_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
696#else
697# define _GLIBCXX11_DEPRECATED
698# define _GLIBCXX11_DEPRECATED_SUGGEST(ALT)
699#endif
700
701#if defined(__DEPRECATED) && (__cplusplus >= 201402L)
702# define _GLIBCXX14_DEPRECATED _GLIBCXX_DEPRECATED
703# define _GLIBCXX14_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
704#else
705# define _GLIBCXX14_DEPRECATED
706# define _GLIBCXX14_DEPRECATED_SUGGEST(ALT)
707#endif
708
709#if defined(__DEPRECATED) && (__cplusplus >= 201703L)
710# define _GLIBCXX17_DEPRECATED [[__deprecated__]]
711# define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
712#else
713# define _GLIBCXX17_DEPRECATED
714# define _GLIBCXX17_DEPRECATED_SUGGEST(ALT)
715#endif
716
717#if defined(__DEPRECATED) && (__cplusplus >= 202002L)
718# define _GLIBCXX20_DEPRECATED [[__deprecated__]]
719# define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
720#else
721# define _GLIBCXX20_DEPRECATED
722# define _GLIBCXX20_DEPRECATED_SUGGEST(ALT)
723#endif
724
725#if defined(__DEPRECATED) && (__cplusplus >= 202100L)
726# define _GLIBCXX23_DEPRECATED [[__deprecated__]]
727# define _GLIBCXX23_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
728#else
729# define _GLIBCXX23_DEPRECATED
730# define _GLIBCXX23_DEPRECATED_SUGGEST(ALT)
731#endif
732
733#if defined(__DEPRECATED) && (__cplusplus >= 202400L)
734# define _GLIBCXX26_DEPRECATED [[__deprecated__]]
735# define _GLIBCXX26_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
736#else
737# define _GLIBCXX26_DEPRECATED
738# define _GLIBCXX26_DEPRECATED_SUGGEST(ALT)
739#endif
740
741// Macros for ABI tag attributes.
742#ifndef _GLIBCXX_ABI_TAG_CXX11
743# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
744#endif
745
746// Macro to warn about unused results.
747#if __cplusplus >= 201103L
748# define _GLIBCXX_NODISCARD [[__nodiscard__]]
749#else
750# define _GLIBCXX_NODISCARD
751#endif
752
753
754
755#if __cplusplus
756
757// Macro for constexpr, to support in mixed 03/0x mode.
758#ifndef _GLIBCXX_CONSTEXPR
759# if __cplusplus >= 201103L
760# define _GLIBCXX_CONSTEXPR constexpr
761# define _GLIBCXX_USE_CONSTEXPR constexpr
762# else
763# define _GLIBCXX_CONSTEXPR
764# define _GLIBCXX_USE_CONSTEXPR const
765# endif
766#endif
767
768#ifndef _GLIBCXX14_CONSTEXPR
769# if __cplusplus >= 201402L
770# define _GLIBCXX14_CONSTEXPR constexpr
771# else
772# define _GLIBCXX14_CONSTEXPR
773# endif
774#endif
775
776#ifndef _GLIBCXX17_CONSTEXPR
777# if __cplusplus >= 201703L
778# define _GLIBCXX17_CONSTEXPR constexpr
779# else
780# define _GLIBCXX17_CONSTEXPR
781# endif
782#endif
783
784#ifndef _GLIBCXX20_CONSTEXPR
785# if __cplusplus >= 202002L
786# define _GLIBCXX20_CONSTEXPR constexpr
787# else
788# define _GLIBCXX20_CONSTEXPR
789# endif
790#endif
791
792#ifndef _GLIBCXX23_CONSTEXPR
793# if __cplusplus >= 202100L
794# define _GLIBCXX23_CONSTEXPR constexpr
795# else
796# define _GLIBCXX23_CONSTEXPR
797# endif
798#endif
799
800#ifndef _GLIBCXX26_CONSTEXPR
801# if __cplusplus >= 202400L
802# define _GLIBCXX26_CONSTEXPR constexpr
803# else
804# define _GLIBCXX26_CONSTEXPR
805# endif
806#endif
807
808#ifndef _GLIBCXX17_INLINE
809# if __cplusplus >= 201703L
810# define _GLIBCXX17_INLINE inline
811# else
812# define _GLIBCXX17_INLINE
813# endif
814#endif
815
816// Macro for noexcept, to support in mixed 03/0x mode.
817#ifndef _GLIBCXX_NOEXCEPT
818# if __cplusplus >= 201103L
819# define _GLIBCXX_NOEXCEPT noexcept
820# define _GLIBCXX_NOEXCEPT_IF(...) noexcept(__VA_ARGS__)
821# define _GLIBCXX_USE_NOEXCEPT noexcept
822# define _GLIBCXX_THROW(_EXC)
823# else
824# define _GLIBCXX_NOEXCEPT
825# define _GLIBCXX_NOEXCEPT_IF(...)
826# define _GLIBCXX_USE_NOEXCEPT throw()
827# define _GLIBCXX_THROW(_EXC) throw(_EXC)
828# endif
829#endif
830
831#ifndef _GLIBCXX_NOTHROW
832# define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT
833#endif
834
835#ifndef _GLIBCXX_THROW_OR_ABORT
836# if __cpp_exceptions
837# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC))
838# else
839# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort(), (void)(_EXC))
840# endif
841#endif
842
843#if __cpp_noexcept_function_type
844#define _GLIBCXX_NOEXCEPT_PARM , bool _NE
845#define _GLIBCXX_NOEXCEPT_QUAL noexcept (_NE)
846#else
847#define _GLIBCXX_NOEXCEPT_PARM
848#define _GLIBCXX_NOEXCEPT_QUAL
849#endif
850
851#if __cpp_auto_cast
852# define _GLIBCXX_AUTO_CAST(X) auto(X)
853#else
854# define _GLIBCXX_AUTO_CAST(X) ::std::__decay_t<decltype((X))>(X)
855#endif
856
857// Macro for extern template, ie controlling template linkage via use
858// of extern keyword on template declaration. As documented in the g++
859// manual, it inhibits all implicit instantiations and is used
860// throughout the library to avoid multiple weak definitions for
861// required types that are already explicitly instantiated in the
862// library binary. This substantially reduces the binary size of
863// resulting executables.
864// Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
865// templates only in basic_string, thus activating its debug-mode
866// checks even at -O0.
867#define _GLIBCXX_EXTERN_TEMPLATE
868
869/*
870 Outline of libstdc++ namespaces.
871
872 namespace std
873 {
874 namespace __debug { }
875 namespace __parallel { }
876 namespace __cxx1998 { }
877
878 namespace __detail {
879 namespace __variant { } // C++17
880 }
881
882 namespace rel_ops { }
883
884 namespace tr1
885 {
886 namespace placeholders { }
887 namespace regex_constants { }
888 namespace __detail { }
889 }
890
891 namespace tr2 { }
892
893 namespace decimal { }
894
895 namespace chrono { } // C++11
896 namespace placeholders { } // C++11
897 namespace regex_constants { } // C++11
898 namespace this_thread { } // C++11
899 inline namespace literals { // C++14
900 inline namespace chrono_literals { } // C++14
901 inline namespace complex_literals { } // C++14
902 inline namespace string_literals { } // C++14
903 inline namespace string_view_literals { } // C++17
904 }
905 }
906
907 namespace abi { }
908
909 namespace __gnu_cxx
910 {
911 namespace __detail { }
912 }
913
914 For full details see:
915 http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html
916*/
917namespace std
918{
919 typedef __SIZE_TYPE__ size_t;
920 typedef __PTRDIFF_TYPE__ ptrdiff_t;
921
922#if __cplusplus >= 201103L
923 typedef decltype(nullptr) nullptr_t;
924#endif
925
926#pragma GCC visibility push(default)
927 // This allows the library to terminate without including all of <exception>
928 // and without making the declaration of std::terminate visible to users.
929 extern "C++" __attribute__ ((__noreturn__, __always_inline__))
930 inline void __terminate() _GLIBCXX_USE_NOEXCEPT
931 {
932 void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__,__cold__));
933 terminate();
934 }
935#pragma GCC visibility pop
936}
937
938#define _GLIBCXX_USE_DUAL_ABI
939
940# undef _GLIBCXX_USE_CXX11_ABI
941#endif
942
943#ifndef _GLIBCXX_USE_CXX11_ABI
944#define _GLIBCXX_USE_CXX11_ABI
945#endif
946
947namespace std
948{
949 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
950}
951namespace __gnu_cxx
952{
953 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
954}
955# define _GLIBCXX_NAMESPACE_CXX11 __cxx11::
956# define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 {
957# define _GLIBCXX_END_NAMESPACE_CXX11 }
958# define _GLIBCXX_DEFAULT_ABI_TAG _GLIBCXX_ABI_TAG_CXX11
959#else
960# define _GLIBCXX_NAMESPACE_CXX11
961# define _GLIBCXX_BEGIN_NAMESPACE_CXX11
962# define _GLIBCXX_END_NAMESPACE_CXX11
963# define _GLIBCXX_DEFAULT_ABI_TAG
964#endif
965
966// Non-zero if inline namespaces are used for versioning the entire library.
967#define _GLIBCXX_INLINE_VERSION
968
969// Inline namespace for symbol versioning of (nearly) everything in std.
970# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __8 {
971# define _GLIBCXX_END_NAMESPACE_VERSION }
972// Unused when everything in std is versioned anyway.
973# define _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(X)
974# define _GLIBCXX_END_INLINE_ABI_NAMESPACE(X)
975
976namespace std
977{
978inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
979#if __cplusplus >= 201402L
980 inline namespace literals {
981 inline namespace chrono_literals { }
982 inline namespace complex_literals { }
983 inline namespace string_literals { }
984#if __cplusplus > 201402L
985 inline namespace string_view_literals { }
986#endif // C++17
987 }
988#endif // C++14
989_GLIBCXX_END_NAMESPACE_VERSION
990}
991
992namespace __gnu_cxx
993{
994inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
995_GLIBCXX_END_NAMESPACE_VERSION
996}
997
998#else
999// Unused.
1000# define _GLIBCXX_BEGIN_NAMESPACE_VERSION
1001# define _GLIBCXX_END_NAMESPACE_VERSION
1002// Used to version individual components, e.g. std::_V2::error_category.
1003# define _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(X) inline namespace X {
1004# define _GLIBCXX_END_INLINE_ABI_NAMESPACE(X) } // inline namespace X
1005#endif
1006
1007// In the case that we don't have a hosted environment, we can't provide the
1008// debugging mode. Instead, we do our best and downgrade to assertions.
1009#if defined(_GLIBCXX_DEBUG) && !__STDC_HOSTED__
1010#undef _GLIBCXX_DEBUG
1011#define _GLIBCXX_ASSERTIONS 1
1012#endif
1013
1014// Inline namespaces for special modes: debug, parallel.
1015#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
1016namespace std
1017{
1018_GLIBCXX_BEGIN_NAMESPACE_VERSION
1019
1020 // Non-inline namespace for components replaced by alternates in active mode.
1021 namespace __cxx1998
1022 {
1023# if _GLIBCXX_USE_CXX11_ABI
1024 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
1025# endif
1026 }
1027
1028_GLIBCXX_END_NAMESPACE_VERSION
1029
1030 // Inline namespace for debug mode.
1031# ifdef _GLIBCXX_DEBUG
1032 inline namespace __debug { }
1033# endif
1034
1035 // Inline namespaces for parallel mode.
1036# ifdef _GLIBCXX_PARALLEL
1037 inline namespace __parallel { }
1038# endif
1039}
1040
1041// Check for invalid usage and unsupported mixed-mode use.
1042# if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL)
1043# error illegal use of multiple inlined namespaces
1044# endif
1045
1046// Check for invalid use due to lack for weak symbols.
1047# if __NO_INLINE__ && !__GXX_WEAK__
1048# warning currently using inlined namespace mode which may fail \
1049 without inlining due to lack of weak symbols
1050# endif
1051#endif
1052
1053// Macros for namespace scope. Either namespace std:: or the name
1054// of some nested namespace within it corresponding to the active mode.
1055// _GLIBCXX_STD_A
1056// _GLIBCXX_STD_C
1057//
1058// Macros for opening/closing conditional namespaces.
1059// _GLIBCXX_BEGIN_NAMESPACE_ALGO
1060// _GLIBCXX_END_NAMESPACE_ALGO
1061// _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
1062// _GLIBCXX_END_NAMESPACE_CONTAINER
1063#if defined(_GLIBCXX_DEBUG)
1064# define _GLIBCXX_STD_C __cxx1998
1065# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
1066 namespace _GLIBCXX_STD_C {
1067# define _GLIBCXX_END_NAMESPACE_CONTAINER }
1068#else
1069# define _GLIBCXX_STD_C std
1070# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
1071# define _GLIBCXX_END_NAMESPACE_CONTAINER
1072#endif
1073
1074#ifdef _GLIBCXX_PARALLEL
1075# define _GLIBCXX_STD_A __cxx1998
1076# define _GLIBCXX_BEGIN_NAMESPACE_ALGO \
1077 namespace _GLIBCXX_STD_A {
1078# define _GLIBCXX_END_NAMESPACE_ALGO }
1079#else
1080# define _GLIBCXX_STD_A std
1081# define _GLIBCXX_BEGIN_NAMESPACE_ALGO
1082# define _GLIBCXX_END_NAMESPACE_ALGO
1083#endif
1084
1085// GLIBCXX_ABI Deprecated
1086// Define if compatibility should be provided for -mlong-double-64.
1087#undef _GLIBCXX_LONG_DOUBLE_COMPAT
1088
1089// Use an alternate macro to test for clang, so as to provide an easy
1090// workaround for systems (such as vxworks) whose headers require
1091// __clang__ to be defined, even when compiling with GCC.
1092#if !defined _GLIBCXX_CLANG && defined __clang__
1093# define _GLIBCXX_CLANG __clang__
1094// Turn -D_GLIBCXX_CLANG=0 into -U_GLIBCXX_CLANG, so that
1095// _GLIBCXX_CLANG can be tested as defined, just like __clang__.
1096#elif !_GLIBCXX_CLANG
1097# undef _GLIBCXX_CLANG
1098#endif
1099
1100// Define if compatibility should be provided for alternative 128-bit long
1101// double formats. Not possible for Clang until __ibm128 is supported.
1102#ifndef _GLIBCXX_CLANG
1103#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
1104#endif
1105
1106// Inline namespaces for long double 128 modes.
1107#if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \
1108 && defined __LONG_DOUBLE_IEEE128__
1109namespace std
1110{
1111 // Namespaces for 128-bit IEEE long double format on 64-bit POWER LE.
1112 inline namespace __gnu_cxx_ieee128 { }
1113 inline namespace __gnu_cxx11_ieee128 { }
1114}
1115# define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ieee128::
1116# define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ieee128 {
1117# define _GLIBCXX_END_NAMESPACE_LDBL }
1118# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 __gnu_cxx11_ieee128::
1119# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 namespace __gnu_cxx11_ieee128 {
1120# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 }
1121
1122#else // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
1123
1124#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1125namespace std
1126{
1127 inline namespace __gnu_cxx_ldbl128 { }
1128}
1129# define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128::
1130# define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 {
1131# define _GLIBCXX_END_NAMESPACE_LDBL }
1132#else
1133# define _GLIBCXX_NAMESPACE_LDBL
1134# define _GLIBCXX_BEGIN_NAMESPACE_LDBL
1135# define _GLIBCXX_END_NAMESPACE_LDBL
1136#endif
1137
1138
1139
1140#endif // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
1141
1142namespace std
1143{
1144#pragma GCC visibility push(default)
1145 // Internal version of std::is_constant_evaluated().
1146 // This can be used without checking if the compiler supports the feature.
1147 // The macro _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED can be used to check if
1148 // the compiler support is present to make this function work as expected.
1149 __attribute__((__always_inline__))
1150 _GLIBCXX_CONSTEXPR inline bool
1151 __is_constant_evaluated() _GLIBCXX_NOEXCEPT
1152 {
1153#if __cpp_if_consteval >= 202106L
1154# define _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED 1
1155 if consteval { return true; } else { return false; }
1156#elif __cplusplus >= 201103L && __has_builtin(__builtin_is_constant_evaluated)
1157# define _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED 1
1158 return __builtin_is_constant_evaluated();
1159#else
1160 return false;
1161#endif
1162 }
1163#pragma GCC visibility pop
1164}
1165
1166#ifndef _GLIBCXX_ASSERTIONS
1167# if defined(_GLIBCXX_DEBUG)
1168// Debug Mode implies checking assertions.
1169# define _GLIBCXX_ASSERTIONS 1
1170# elif ! defined(__OPTIMIZE__) && ! defined(_GLIBCXX_NO_ASSERTIONS)
1171// Enable assertions for unoptimized builds.
1172# define _GLIBCXX_ASSERTIONS 1
1173# endif
1174#endif
1175
1176// Disable std::string explicit instantiation declarations in order to assert.
1177#ifdef _GLIBCXX_ASSERTIONS
1178# undef _GLIBCXX_EXTERN_TEMPLATE
1179# define _GLIBCXX_EXTERN_TEMPLATE -1
1180#endif
1181
1182#undef _GLIBCXX_VERBOSE_ASSERT
1183
1184// Assert.
1185#ifdef _GLIBCXX_VERBOSE_ASSERT
1186namespace std
1187{
1188#pragma GCC visibility push(default)
1189 // Don't use <cassert> because this should be unaffected by NDEBUG.
1190 extern "C++" _GLIBCXX_NORETURN __attribute__((__cold__))
1191 void
1192 __glibcxx_assert_fail /* Called when a precondition violation is detected. */
1193 (const char* __file, int __line, const char* __function,
1194 const char* __condition)
1195 _GLIBCXX_NOEXCEPT;
1196#pragma GCC visibility pop
1197}
1198# define _GLIBCXX_ASSERT_FAIL(_Condition) \
1199 std::__glibcxx_assert_fail(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
1200 #_Condition)
1201#else // ! VERBOSE_ASSERT
1202# define _GLIBCXX_ASSERT_FAIL(_Condition) __builtin_abort()
1203#endif
1204
1205#if defined(_GLIBCXX_ASSERTIONS)
1206// When _GLIBCXX_ASSERTIONS is defined we enable runtime assertion checks.
1207// These checks will also be done during constant evaluation.
1208# define __glibcxx_assert(cond) \
1209 do { \
1210 if (__builtin_expect(!bool(cond), false)) \
1211 _GLIBCXX_ASSERT_FAIL(cond); \
1212 } while (false)
1213#elif _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
1214// _GLIBCXX_ASSERTIONS is not defined, so assertions checks are only enabled
1215// during constant evaluation. This ensures we diagnose undefined behaviour
1216// in constant expressions.
1217namespace std
1218{
1219 __attribute__((__always_inline__,__visibility__("default")))
1220 inline void
1221 __glibcxx_assert_fail()
1222 { }
1223}
1224# define __glibcxx_assert(cond) \
1225 do { \
1226 if (std::__is_constant_evaluated() && !bool(cond)) \
1227 std::__glibcxx_assert_fail(); \
1228 } while (false)
1229#else
1230// _GLIBCXX_ASSERTIONS is not defined and __is_constant_evaluated() doesn't
1231// work so don't check any assertions.
1232# define __glibcxx_assert(cond)
1233#endif
1234
1235// Macro indicating that TSAN is in use.
1236#if __SANITIZE_THREAD__
1237# define _GLIBCXX_TSAN 1
1238#elif defined __has_feature
1239# if __has_feature(thread_sanitizer)
1240# define _GLIBCXX_TSAN 1
1241# endif
1242#endif
1243
1244// Macros for race detectors.
1245// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and
1246// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain
1247// atomic (lock-free) synchronization to race detectors:
1248// the race detector will infer a happens-before arc from the former to the
1249// latter when they share the same argument pointer.
1250//
1251// The most frequent use case for these macros (and the only case in the
1252// current implementation of the library) is atomic reference counting:
1253// void _M_remove_reference()
1254// {
1255// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
1256// if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
1257// {
1258// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
1259// _M_destroy(__a);
1260// }
1261// }
1262// The annotations in this example tell the race detector that all memory
1263// accesses occurred when the refcount was positive do not race with
1264// memory accesses which occurred after the refcount became zero.
1265#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE
1266# define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A)
1267#endif
1268#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER
1269# define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
1270#endif
1271
1272// Macros for C linkage: define extern "C" linkage only when using C++.
1273# define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
1274# define _GLIBCXX_END_EXTERN_C }
1275
1276#define _GLIBCXX_USE_ALLOCATOR_NEW
1277
1278#ifdef __SIZEOF_INT128__
1279#if ! defined __GLIBCXX_TYPE_INT_N_0 && ! defined __STRICT_ANSI__
1280// If __int128 is supported, we expect __GLIBCXX_TYPE_INT_N_0 to be defined
1281// unless the compiler is in strict mode. If it's not defined and the strict
1282// macro is not defined, something is wrong.
1283#warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
1284#endif
1285#endif
1286
1287
1288
1289
1290// First includes.
1291
1292// Pick up any OS-specific definitions.
1293// Specific definitions for newlib -*- C++ -*-
1294
1295// Copyright (C) 2000-2014 Free Software Foundation, Inc.
1296//
1297// This file is part of the GNU ISO C++ Library. This library is free
1298// software; you can redistribute it and/or modify it under the
1299// terms of the GNU General Public License as published by the
1300// Free Software Foundation; either version 3, or (at your option)
1301// any later version.
1302
1303// This library is distributed in the hope that it will be useful,
1304// but WITHOUT ANY WARRANTY; without even the implied warranty of
1305// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1306// GNU General Public License for more details.
1307
1308// Under Section 7 of GPL version 3, you are granted additional
1309// permissions described in the GCC Runtime Library Exception, version
1310// 3.1, as published by the Free Software Foundation.
1311
1312// You should have received a copy of the GNU General Public License and
1313// a copy of the GCC Runtime Library Exception along with this program;
1314// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1315// <http://www.gnu.org/licenses/>.
1316
1317/** @file bits/os_defines.h
1318 * This is an internal header file, included by other library headers.
1319 * Do not attempt to use it directly. @headername{iosfwd}
1320 */
1321
1322#ifndef _GLIBCXX_OS_DEFINES
1323#define _GLIBCXX_OS_DEFINES 1
1324
1325// System-specific #define, typedefs, corrections, etc, go here. This
1326// file will come before all others.
1327
1328#ifdef __CYGWIN__
1329#define _GLIBCXX_GTHREAD_USE_WEAK 0
1330
1331#if defined (_GLIBCXX_DLL)
1332#define _GLIBCXX_PSEUDO_VISIBILITY_default __attribute__ ((__dllimport__))
1333#else
1334#define _GLIBCXX_PSEUDO_VISIBILITY_default
1335#endif
1336#define _GLIBCXX_PSEUDO_VISIBILITY_hidden
1337
1338#define _GLIBCXX_PSEUDO_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY_ ## V
1339
1340// See libstdc++/20806.
1341#define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1
1342#endif
1343
1344#endif
1345
1346// Pick up any CPU-specific definitions.
1347// Specific definitions for generic platforms -*- C++ -*-
1348
1349// Copyright (C) 2005-2014 Free Software Foundation, Inc.
1350//
1351// This file is part of the GNU ISO C++ Library. This library is free
1352// software; you can redistribute it and/or modify it under the
1353// terms of the GNU General Public License as published by the
1354// Free Software Foundation; either version 3, or (at your option)
1355// any later version.
1356
1357// This library is distributed in the hope that it will be useful,
1358// but WITHOUT ANY WARRANTY; without even the implied warranty of
1359// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1360// GNU General Public License for more details.
1361
1362// Under Section 7 of GPL version 3, you are granted additional
1363// permissions described in the GCC Runtime Library Exception, version
1364// 3.1, as published by the Free Software Foundation.
1365
1366// You should have received a copy of the GNU General Public License and
1367// a copy of the GCC Runtime Library Exception along with this program;
1368// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1369// <http://www.gnu.org/licenses/>.
1370
1371/** @file bits/cpu_defines.h
1372 * This is an internal header file, included by other library headers.
1373 * Do not attempt to use it directly. @headername{iosfwd}
1374 */
1375
1376#ifndef _GLIBCXX_CPU_DEFINES
1377#define _GLIBCXX_CPU_DEFINES 1
1378
1379#endif
1380
1381// If platform uses neither visibility nor psuedo-visibility,
1382// specify empty default for namespace annotation macros.
1383#ifndef _GLIBCXX_PSEUDO_VISIBILITY
1384# define _GLIBCXX_PSEUDO_VISIBILITY(V)
1385#endif
1386
1387// Certain function definitions that are meant to be overridable from
1388// user code are decorated with this macro. For some targets, this
1389// macro causes these definitions to be weak.
1390#ifndef _GLIBCXX_WEAK_DEFINITION
1391# define _GLIBCXX_WEAK_DEFINITION
1392#endif
1393
1394// By default, we assume that __GXX_WEAK__ also means that there is support
1395// for declaring functions as weak while not defining such functions. This
1396// allows for referring to functions provided by other libraries (e.g.,
1397// libitm) without depending on them if the respective features are not used.
1398#ifndef _GLIBCXX_USE_WEAK_REF
1399# define _GLIBCXX_USE_WEAK_REF __GXX_WEAK__
1400#endif
1401
1402// Conditionally enable annotations for the Transactional Memory TS on C++11.
1403// Most of the following conditions are due to limitations in the current
1404// implementation.
1405
1406#if __cplusplus > 201402L
1407// In C++17 mathematical special functions are in namespace std.
1408# define _GLIBCXX_USE_STD_SPEC_FUNCS 1
1409#elif __cplusplus >= 201103L && __STDCPP_WANT_MATH_SPEC_FUNCS__ != 0
1410// For C++11 and C++14 they are in namespace std when requested.
1411# define _GLIBCXX_USE_STD_SPEC_FUNCS 1
1412#endif
1413
1414// The remainder of the prewritten config is automatic; all the
1415// user hooks are listed above.
1416
1417// Create a boolean flag to be used to determine if --fast-math is set.
1418#ifdef __FAST_MATH__
1419# define _GLIBCXX_FAST_MATH 1
1420#else
1421# define _GLIBCXX_FAST_MATH 0
1422#endif
1423
1424// This marks string literals in header files to be extracted for eventual
1425// translation. It is primarily used for messages in thrown exceptions; see
1426// src/functexcept.cc. We use __N because the more traditional _N is used
1427// for something else under certain OSes (see BADNAMES).
1428#define __N(msgid) (msgid)
1429
1430// For example, <windows.h> is known to #define min and max as macros...
1431#undef min
1432#undef max
1433
1434// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally
1435// so they should be tested with #if not with #ifdef.
1436#if __cplusplus >= 201103L
1437# ifndef _GLIBCXX_USE_C99_MATH
1438# define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH
1439# endif
1440# ifndef _GLIBCXX_USE_C99_COMPLEX
1441# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX
1442# endif
1443# ifndef _GLIBCXX_USE_C99_STDIO
1444# define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO
1445# endif
1446# ifndef _GLIBCXX_USE_C99_STDLIB
1447# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB
1448# endif
1449# ifndef _GLIBCXX_USE_C99_WCHAR
1450# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR
1451# endif
1452#else
1453# ifndef _GLIBCXX_USE_C99_MATH
1454# define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH
1455# endif
1456# ifndef _GLIBCXX_USE_C99_COMPLEX
1457# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX
1458# endif
1459# ifndef _GLIBCXX_USE_C99_STDIO
1460# define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO
1461# endif
1462# ifndef _GLIBCXX_USE_C99_STDLIB
1463# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB
1464# endif
1465# ifndef _GLIBCXX_USE_C99_WCHAR
1466# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR
1467# endif
1468#endif
1469
1470// Unless explicitly specified, enable char8_t extensions only if the core
1471// language char8_t feature macro is defined.
1472#ifndef _GLIBCXX_USE_CHAR8_T
1473# ifdef __cpp_char8_t
1474# define _GLIBCXX_USE_CHAR8_T 1
1475# endif
1476#endif
1477#ifdef _GLIBCXX_USE_CHAR8_T
1478# define __cpp_lib_char8_t 201907L
1479#endif
1480
1481/* Define if __float128 is supported on this host. */
1482#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
1483/* For powerpc64 don't use __float128 when it's the same type as long double. */
1484# if !(defined(_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT) && defined(__LONG_DOUBLE_IEEE128__))
1485# define _GLIBCXX_USE_FLOAT128
1486# endif
1487#endif
1488
1489#if __FLT_MANT_DIG__ == 24 \
1490 && __FLT_MIN_EXP__ == -125 \
1491 && __FLT_MAX_EXP__ == 128
1492// Define if float has the IEEE binary32 format.
1493# define _GLIBCXX_FLOAT_IS_IEEE_BINARY32 1
1494#endif
1495
1496#if __DBL_MANT_DIG__ == 53 \
1497 && __DBL_MIN_EXP__ == -1021 \
1498 && __DBL_MAX_EXP__ == 1024
1499// Define if double has the IEEE binary64 format.
1500# define _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 1
1501#elif __FLT_MANT_DIG__ == 24 \
1502 && __FLT_MIN_EXP__ == -125 \
1503 && __FLT_MAX_EXP__ == 128
1504// Define if double has the IEEE binary32 format.
1505# define _GLIBCXX_DOUBLE_IS_IEEE_BINARY32 1
1506#endif
1507
1508#if __LDBL_MANT_DIG__ == 113 \
1509 && __LDBL_MIN_EXP__ == -16381 \
1510 && __LDBL_MAX_EXP__ == 16384
1511// Define if long double has the IEEE binary128 format.
1512# define _GLIBCXX_LDOUBLE_IS_IEEE_BINARY128 1
1513#elif __LDBL_MANT_DIG__ == 53 \
1514 && __LDBL_MIN_EXP__ == -1021 \
1515 && __LDBL_MAX_EXP__ == 1024
1516// Define if long double has the IEEE binary64 format.
1517# define _GLIBCXX_LDOUBLE_IS_IEEE_BINARY64 1
1518#elif __LDBL_MANT_DIG__ == 24 \
1519 && __LDBL_MIN_EXP__ == -125 \
1520 && __LDBL_MAX_EXP__ == 128
1521// Define if long double has the IEEE binary32 format.
1522# define _GLIBCXX_LDOUBLE_IS_IEEE_BINARY32 1
1523#endif
1524
1525#if defined __cplusplus && defined __BFLT16_DIG__
1526namespace __gnu_cxx
1527{
1528 typedef __decltype(0.0bf16) __bfloat16_t;
1529}
1530#endif
1531
1532#ifdef __has_builtin
1533# ifdef __is_identifier
1534// Intel and older Clang require !__is_identifier for some built-ins:
1535# define _GLIBCXX_HAS_BUILTIN(B) (__has_builtin(B) || ! __is_identifier(B))
1536# else
1537# define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B)
1538# endif
1539#endif
1540
1541#if _GLIBCXX_HAS_BUILTIN(__has_unique_object_representations)
1542# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
1543#endif
1544
1545#if _GLIBCXX_HAS_BUILTIN(__is_aggregate)
1546# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
1547#endif
1548
1549#if _GLIBCXX_HAS_BUILTIN(__builtin_launder)
1550# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
1551#endif
1552
1553// Returns 1 if _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS is not defined and the
1554// compiler has a corresponding built-in type trait, 0 otherwise.
1555// _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS can be defined to disable the use of
1556// built-in traits.
1557#ifndef _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS
1558# define _GLIBCXX_USE_BUILTIN_TRAIT(BT) _GLIBCXX_HAS_BUILTIN(BT)
1559#else
1560# define _GLIBCXX_USE_BUILTIN_TRAIT(BT) 0
1561#endif
1562
1563// Mark code that should be ignored by the compiler, but seen by Doxygen.
1564#define _GLIBCXX_DOXYGEN_ONLY(X)
1565
1566// PSTL configuration
1567
1568#if __cplusplus >= 201703L
1569// This header is not installed for freestanding:
1570#if __has_include(<pstl/pstl_config.h>)
1571// Preserved here so we have some idea which version of upstream we've pulled in
1572// #define PSTL_VERSION 9000
1573
1574// For now this defaults to being based on the presence of Thread Building Blocks
1575# ifndef _GLIBCXX_USE_TBB_PAR_BACKEND
1576# define _GLIBCXX_USE_TBB_PAR_BACKEND __has_include(<tbb/tbb.h>)
1577# endif
1578// This section will need some rework when a new (default) backend type is added
1579# if _GLIBCXX_USE_TBB_PAR_BACKEND
1580# define _PSTL_PAR_BACKEND_TBB
1581# else
1582# define _PSTL_PAR_BACKEND_SERIAL
1583# endif
1584
1585# define _PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition)
1586# define _PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition)
1587
1588// -*- C++ -*-
1589//===-- pstl_config.h -----------------------------------------------------===//
1590//
1591// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
1592// See https://llvm.org/LICENSE.txt for license information.
1593// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
1594//
1595//===----------------------------------------------------------------------===//
1596
1597#ifndef _PSTL_CONFIG_H
1598#define _PSTL_CONFIG_H
1599
1600// The version is XYYZ, where X is major, YY is minor, and Z is patch (i.e. X.YY.Z)
1601#define _PSTL_VERSION 17000
1602#define _PSTL_VERSION_MAJOR (_PSTL_VERSION / 1000)
1603#define _PSTL_VERSION_MINOR ((_PSTL_VERSION % 1000) / 10)
1604#define _PSTL_VERSION_PATCH (_PSTL_VERSION % 10)
1605
1606#if !defined(_PSTL_PAR_BACKEND_SERIAL) && !defined(_PSTL_PAR_BACKEND_TBB) && !defined(_PSTL_PAR_BACKEND_OPENMP)
1607# error "A parallel backend must be specified"
1608#endif
1609
1610// Check the user-defined macro for warnings
1611#if defined(PSTL_USAGE_WARNINGS)
1612# undef _PSTL_USAGE_WARNINGS
1613# define _PSTL_USAGE_WARNINGS PSTL_USAGE_WARNINGS
1614// Check the internal macro for warnings
1615#elif !defined(_PSTL_USAGE_WARNINGS)
1616# define _PSTL_USAGE_WARNINGS 0
1617#endif
1618
1619// Portability "#pragma" definition
1620#ifdef _MSC_VER
1621# define _PSTL_PRAGMA(x) __pragma(x)
1622#else
1623# define _PSTL_PRAGMA(x) _Pragma(# x)
1624#endif
1625
1626#define _PSTL_STRING_AUX(x) #x
1627#define _PSTL_STRING(x) _PSTL_STRING_AUX(x)
1628#define _PSTL_STRING_CONCAT(x, y) x #y
1629
1630#ifdef _PSTL_HIDE_FROM_ABI_PER_TU
1631# define _PSTL_HIDE_FROM_ABI_PUSH \
1632 _Pragma("clang attribute push(__attribute__((internal_linkage)), apply_to=any(function,record))")
1633# define _PSTL_HIDE_FROM_ABI_POP _Pragma("clang attribute pop")
1634#else
1635# define _PSTL_HIDE_FROM_ABI_PUSH /* nothing */
1636# define _PSTL_HIDE_FROM_ABI_POP /* nothing */
1637#endif
1638
1639// note that when ICC or Clang is in use, _PSTL_GCC_VERSION might not fully match
1640// the actual GCC version on the system.
1641#define _PSTL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
1642
1643#if defined(_GLIBCXX_CLANG)
1644// according to clang documentation, version can be vendor specific
1645# define _PSTL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
1646#endif
1647
1648// Enable SIMD for compilers that support OpenMP 4.0
1649#if (defined(_OPENMP) && _OPENMP >= 201307) || \
1650 (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1600) || \
1651 (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \
1652 defined(_GLIBCXX_CLANG)
1653# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
1654# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
1655# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
1656#elif !defined(_MSC_VER) //#pragma simd
1657# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(simd)
1658# define _PSTL_PRAGMA_DECLARE_SIMD
1659# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(simd reduction(PRM))
1660#else //no simd
1661# define _PSTL_PRAGMA_SIMD
1662# define _PSTL_PRAGMA_DECLARE_SIMD
1663# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
1664#endif //Enable SIMD
1665
1666#if defined(__INTEL_COMPILER)
1667# define _PSTL_PRAGMA_FORCEINLINE _PSTL_PRAGMA(forceinline)
1668#else
1669# define _PSTL_PRAGMA_FORCEINLINE
1670#endif
1671
1672#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900) || \
1673 (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
1674# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
1675# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
1676# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
1677#else
1678# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
1679# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
1680# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
1681#endif
1682
1683// Should be defined to 1 for environments with a vendor implementation of C++17 execution policies
1684#define _PSTL_CPP17_EXECUTION_POLICIES_PRESENT (_MSC_VER >= 1912 && _MSVC_LANG >= 201703L) || \
1685 (_GLIBCXX_RELEASE >= 9 && __GLIBCXX__ >= 20190503 && __cplusplus >= 201703L)
1686
1687#if (defined(_MSC_VER) && _MSC_VER >= 1900) || \
1688 __cplusplus >= 201300L || \
1689 __cpp_lib_robust_nonmodifying_seq_ops == 201304
1690# define _PSTL_CPP14_2RANGE_MISMATCH_EQUAL_PRESENT
1691#endif
1692#if (defined(_MSC_VER) && _MSC_VER >= 1900) || \
1693 __cplusplus >= 201402L || \
1694 __cpp_lib_make_reverse_iterator == 201402
1695# define _PSTL_CPP14_MAKE_REVERSE_ITERATOR_PRESENT
1696#endif
1697#if (defined(_MSC_VER) && _MSC_VER >= 1900) || __cplusplus >= 201402L
1698# define _PSTL_CPP14_INTEGER_SEQUENCE_PRESENT
1699#endif
1700#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || \
1701 (defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918) || \
1702 __cplusplus >= 201402L
1703# define _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
1704#endif
1705
1706#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1800
1707# define _PSTL_EARLYEXIT_PRESENT
1708# define _PSTL_MONOTONIC_PRESENT
1709#endif
1710
1711#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900) || \
1712 (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \
1713 (defined(_OPENMP) && _OPENMP >= 201307)
1714# define _PSTL_UDR_PRESENT
1715#endif
1716
1717#if (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1900 && __INTEL_COMPILER_BUILD_DATE >= 20180626) || \
1718 (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 100000)
1719# define _PSTL_UDS_PRESENT
1720#endif
1721
1722#if defined(_PSTL_EARLYEXIT_PRESENT)
1723# define _PSTL_PRAGMA_SIMD_EARLYEXIT _PSTL_PRAGMA(omp simd early_exit)
1724#else
1725# define _PSTL_PRAGMA_SIMD_EARLYEXIT
1726#endif
1727
1728#if defined(_PSTL_MONOTONIC_PRESENT)
1729# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC(PRM) _PSTL_PRAGMA(omp ordered simd monotonic(PRM))
1730# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC_2ARGS(PRM1, PRM2) _PSTL_PRAGMA(omp ordered simd monotonic(PRM1, PRM2))
1731#else
1732# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC(PRM)
1733# define _PSTL_PRAGMA_SIMD_ORDERED_MONOTONIC_2ARGS(PRM1, PRM2)
1734#endif
1735
1736// Declaration of reduction functor, where
1737// NAME - the name of the functor
1738// OP - type of the callable object with the reduction operation
1739// omp_in - refers to the local partial result
1740// omp_out - refers to the final value of the combiner operator
1741// omp_priv - refers to the private copy of the initial value
1742// omp_orig - refers to the original variable to be reduced
1743#define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
1744 _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
1745
1746#if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1600
1747# define _PSTL_PRAGMA_VECTOR_UNALIGNED _PSTL_PRAGMA(vector unaligned)
1748#else
1749# define _PSTL_PRAGMA_VECTOR_UNALIGNED
1750#endif
1751
1752// Check the user-defined macro to use non-temporal stores
1753#if defined(PSTL_USE_NONTEMPORAL_STORES) && (__INTEL_COMPILER >= 1600)
1754# define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED _PSTL_PRAGMA(vector nontemporal)
1755#else
1756# define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
1757#endif
1758
1759#if defined(_MSC_VER) || defined(__INTEL_COMPILER) // the preprocessors don't type a message location
1760# define _PSTL_PRAGMA_LOCATION __FILE__ ":" _PSTL_STRING(__LINE__) ": [Parallel STL message]: "
1761#else
1762# define _PSTL_PRAGMA_LOCATION " [Parallel STL message]: "
1763#endif
1764
1765#define _PSTL_PRAGMA_MESSAGE_IMPL(x) _PSTL_PRAGMA(message(_PSTL_STRING_CONCAT(_PSTL_PRAGMA_LOCATION, x)))
1766
1767#if _PSTL_USAGE_WARNINGS
1768# define _PSTL_PRAGMA_MESSAGE(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
1769# define _PSTL_PRAGMA_MESSAGE_POLICIES(x) _PSTL_PRAGMA_MESSAGE_IMPL(x)
1770#else
1771# define _PSTL_PRAGMA_MESSAGE(x)
1772# define _PSTL_PRAGMA_MESSAGE_POLICIES(x)
1773#endif
1774
1775// broken macros
1776
1777
1778#if defined(__INTEL_COMPILER) && __INTEL_COMPILER == 1800
1779# define _PSTL_ICC_18_OMP_SIMD_BROKEN
1780#endif
1781
1782#endif /* _PSTL_CONFIG_H */
1783#endif // __has_include
1784#endif // C++17
1785
1786#pragma GCC diagnostic pop
1787
1788// End of prewritten config; the settings discovered at configure time follow.
1789// -*- C++ -*- forwarding header.
1790
1791// Copyright (C) 1997-2025 Free Software Foundation, Inc.
1792//
1793// This file is part of the GNU ISO C++ Library. This library is free
1794// software; you can redistribute it and/or modify it under the
1795// terms of the GNU General Public License as published by the
1796// Free Software Foundation; either version 3, or (at your option)
1797// any later version.
1798
1799// This library is distributed in the hope that it will be useful,
1800// but WITHOUT ANY WARRANTY; without even the implied warranty of
1801// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1802// GNU General Public License for more details.
1803
1804// Under Section 7 of GPL version 3, you are granted additional
1805// permissions described in the GCC Runtime Library Exception, version
1806// 3.1, as published by the Free Software Foundation.
1807
1808// You should have received a copy of the GNU General Public License and
1809// a copy of the GCC Runtime Library Exception along with this program;
1810// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1811// <http://www.gnu.org/licenses/>.
1812
1813/** @file include/cstdarg
1814 * This is a Standard C++ Library file. You should @c \#include this file
1815 * in your programs, rather than any of the @a *.h implementation files.
1816 *
1817 * This is the C++ version of the Standard C Library header @c stdarg.h,
1818 * and its contents are (mostly) the same as that header, but are all
1819 * contained in the namespace @c std (except for names which are defined
1820 * as macros in C).
1821 */
1822
1823//
1824// ISO C++ 14882: 20.4.6 C library
1825//
1826
1827#ifndef _GLIBCXX_CSTDARG
1828#define _GLIBCXX_CSTDARG 1
1829
1830#ifdef _GLIBCXX_SYSHDR
1831#pragma GCC system_header
1832#endif
1833
1834#undef __need___va_list
1835/* $OpenBSD: stdarg.h,v 1.10 2020/07/21 23:09:00 daniel Exp $ */
1836/*
1837 * Copyright (c) 2003, 2004 Marc espie <[email protected]>
1838 *
1839 * Permission to use, copy, modify, and distribute this software for any
1840 * purpose with or without fee is hereby granted, provided that the above
1841 * copyright notice and this permission notice appear in all copies.
1842 *
1843 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1844 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1845 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1846 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1847 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1848 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1849 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1850 */
1851
1852#ifndef _STDARG_H_
1853#define _STDARG_H_
1854
1855/*-
1856 * SPDX-License-Identifier: BSD-3-Clause
1857 *
1858 * Copyright (c) 1991, 1993
1859 * The Regents of the University of California. All rights reserved.
1860 *
1861 * This code is derived from software contributed to Berkeley by
1862 * Berkeley Software Design, Inc.
1863 *
1864 * Redistribution and use in source and binary forms, with or without
1865 * modification, are permitted provided that the following conditions
1866 * are met:
1867 * 1. Redistributions of source code must retain the above copyright
1868 * notice, this list of conditions and the following disclaimer.
1869 * 2. Redistributions in binary form must reproduce the above copyright
1870 * notice, this list of conditions and the following disclaimer in the
1871 * documentation and/or other materials provided with the distribution.
1872 * 3. Neither the name of the University nor the names of its contributors
1873 * may be used to endorse or promote products derived from this software
1874 * without specific prior written permission.
1875 *
1876 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1877 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1878 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1879 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1880 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1881 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1882 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1883 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1884 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1885 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1886 * SUCH DAMAGE.
1887 */
1888
1889#ifndef _SYS_CDEFS_H_
1890#define _SYS_CDEFS_H_
1891
1892#if defined(_KERNEL) && defined(_STANDALONE)
1893#error "_KERNEL and _STANDALONE are mutually exclusive"
1894#endif
1895
1896/*
1897 * Provide clang-compatible testing macros. All supported versions of gcc (10+)
1898 * provide all of these except has_feature and has_extension which are new in
1899 * gcc 14. Keep the older ifndefs, though, for non-gcc compilers that may lack
1900 * them like tcc and pcc.
1901 */
1902#ifndef __has_attribute
1903#define __has_attribute(x) 0
1904#endif
1905#ifndef __has_extension
1906#define __has_extension __has_feature
1907#endif
1908#ifndef __has_feature
1909#define __has_feature(x) 0
1910#endif
1911#ifndef __has_include
1912#define __has_include(x) 0
1913#endif
1914#ifndef __has_builtin
1915#define __has_builtin(x) 0
1916#endif
1917
1918#if defined(__cplusplus)
1919#define __BEGIN_DECLS extern "C" {
1920#define __END_DECLS }
1921#else
1922#define __BEGIN_DECLS
1923#define __END_DECLS
1924#endif
1925
1926/*
1927 * This code has been put in place to help reduce the addition of
1928 * compiler specific defines in FreeBSD code. It helps to aid in
1929 * having a compiler-agnostic source tree.
1930 */
1931
1932/*
1933 * Macro to test if we're using a specific version of gcc or later.
1934 */
1935#if defined(__GNUC__)
1936#define __GNUC_PREREQ__(ma, mi) \
1937 (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
1938#else
1939#define __GNUC_PREREQ__(ma, mi) 0
1940#endif
1941
1942#if defined(__GNUC__)
1943
1944/*
1945 * Compiler memory barriers, specific to gcc and clang.
1946 */
1947#define __compiler_membar() __asm __volatile(" " : : : "memory")
1948
1949#define __CC_SUPPORTS___INLINE 1
1950#define __CC_SUPPORTS_SYMVER 1
1951
1952#endif /* __GNUC__ */
1953
1954/*
1955 * TinyC pretends to be gcc 9.3. This is generally good enough to support
1956 * everything FreeBSD... except for the .symver assembler directive.
1957 */
1958#ifdef __TINYC__
1959#undef __CC_SUPPORTS_SYMVER
1960#endif
1961
1962/*
1963 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
1964 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
1965 * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
1966 * mode -- there must be no spaces between its arguments, and for nested
1967 * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
1968 * concatenate double-quoted strings produced by the __STRING macro, but
1969 * this only works with ANSI C.
1970 *
1971 * __XSTRING is like __STRING, but it expands any macros in its argument
1972 * first. It is only available with ANSI C.
1973 */
1974#if defined(__STDC__) || defined(__cplusplus)
1975#define __P(protos) protos /* full-blown ANSI C */
1976#define __CONCAT1(x,y) x ## y
1977#define __CONCAT(x,y) __CONCAT1(x,y)
1978#define __STRING(x) #x /* stringify without expanding x */
1979#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
1980
1981#define __volatile volatile
1982#if defined(__cplusplus)
1983#define __inline inline /* convert to C++ keyword */
1984#else
1985#if !(defined(__CC_SUPPORTS___INLINE))
1986#define __inline /* delete GCC keyword */
1987#endif /* ! __CC_SUPPORTS___INLINE */
1988#endif /* !__cplusplus */
1989
1990#else /* !(__STDC__ || __cplusplus) */
1991#define __P(protos) () /* traditional C preprocessor */
1992#define __CONCAT(x,y) x/**/y
1993#define __STRING(x) "x"
1994#if !defined(__CC_SUPPORTS___INLINE)
1995/* Just delete these in a K&R environment */
1996#define __inline
1997#define __volatile
1998#endif /* !__CC_SUPPORTS___INLINE */
1999#endif /* !(__STDC__ || __cplusplus) */
2000
2001/*
2002 * Compiler-dependent macros to help declare dead (non-returning) and pure (no
2003 * side effects) functions, and unused variables. These attributes are supported
2004 * by all current compilers, even pcc.
2005 */
2006#define __weak_symbol __attribute__((__weak__))
2007#define __dead2 __attribute__((__noreturn__))
2008#define __pure2 __attribute__((__const__))
2009#define __unused __attribute__((__unused__))
2010#define __used __attribute__((__used__))
2011#define __deprecated __attribute__((__deprecated__))
2012#define __deprecated1(msg) __attribute__((__deprecated__(msg)))
2013#define __packed __attribute__((__packed__))
2014#define __aligned(x) __attribute__((__aligned__(x)))
2015#define __section(x) __attribute__((__section__(x)))
2016#define __writeonly __unused
2017#define __alloc_size(x) __attribute__((__alloc_size__(x)))
2018#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x)))
2019#define __alloc_align(x) __attribute__((__alloc_align__(x)))
2020
2021/*
2022 * Keywords added in C11.
2023 */
2024
2025#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
2026
2027#if !__has_extension(c_alignas)
2028#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
2029 __has_extension(cxx_alignas)
2030#define _Alignas(x) alignas(x)
2031#else
2032/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */
2033#define _Alignas(x) __aligned(x)
2034#endif
2035#endif
2036
2037#if defined(__cplusplus) && __cplusplus >= 201103L
2038#define _Alignof(x) alignof(x)
2039#else
2040#define _Alignof(x) __alignof(x)
2041#endif
2042
2043#if defined(__cplusplus) && __cplusplus >= 201103L
2044#define _Noreturn [[noreturn]]
2045#else
2046#define _Noreturn __dead2
2047#endif
2048
2049#if !__has_extension(c_static_assert)
2050#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
2051 __has_extension(cxx_static_assert)
2052#define _Static_assert(x, y) static_assert(x, y)
2053#endif
2054#endif
2055
2056#if !__has_extension(c_thread_local)
2057#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
2058 __has_extension(cxx_thread_local)
2059#define _Thread_local thread_local
2060#else
2061#define _Thread_local __thread
2062#endif
2063#endif
2064
2065#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */
2066
2067/*
2068 * Emulation of C11 _Generic(). Unlike the previously defined C11
2069 * keywords, it is not possible to implement this using exactly the same
2070 * syntax. Therefore implement something similar under the name
2071 * __generic(). Unlike _Generic(), this macro can only distinguish
2072 * between a single type, so it requires nested invocations to
2073 * distinguish multiple cases.
2074 *
2075 * Note that the comma operator is used to force expr to decay in
2076 * order to match _Generic().
2077 */
2078
2079#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
2080 __has_extension(c_generic_selections)
2081#define __generic(expr, t, yes, no) \
2082 _Generic(expr, t: yes, default: no)
2083#elif !defined(__cplusplus)
2084#define __generic(expr, t, yes, no) \
2085 __builtin_choose_expr(__builtin_types_compatible_p( \
2086 __typeof(((void)0, (expr))), t), yes, no)
2087#endif
2088
2089/*
2090 * C99 Static array indices in function parameter declarations. Syntax such as:
2091 * void bar(int myArray[static 10]);
2092 * is allowed in C99 but not in C++. Define __min_size appropriately so
2093 * headers using it can be compiled in either language. Use like this:
2094 * void bar(int myArray[__min_size(10)]);
2095 */
2096#if !defined(__cplusplus) && \
2097 (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901))
2098#define __min_size(x) static (x)
2099#else
2100#define __min_size(x) (x)
2101#endif
2102
2103#define __malloc_like __attribute__((__malloc__))
2104#define __pure __attribute__((__pure__))
2105
2106#define __always_inline __inline __attribute__((__always_inline__))
2107#define __noinline __attribute__ ((__noinline__))
2108#define __fastcall __attribute__((__fastcall__))
2109#define __result_use_check __attribute__((__warn_unused_result__))
2110#define __returns_twice __attribute__((__returns_twice__))
2111
2112#define __unreachable() __builtin_unreachable()
2113
2114#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
2115#define __LONG_LONG_SUPPORTED
2116#endif
2117
2118/* C++11 exposes a load of C99 stuff */
2119#if defined(__cplusplus) && __cplusplus >= 201103L
2120#define __LONG_LONG_SUPPORTED
2121#ifndef __STDC_LIMIT_MACROS
2122#define __STDC_LIMIT_MACROS
2123#endif
2124#ifndef __STDC_CONSTANT_MACROS
2125#define __STDC_CONSTANT_MACROS
2126#endif
2127#endif
2128
2129/*
2130 * noexcept keyword added in C++11.
2131 */
2132#if defined(__cplusplus) && __cplusplus >= 201103L
2133#define __noexcept noexcept
2134#define __noexcept_if(__c) noexcept(__c)
2135#else
2136#define __noexcept
2137#define __noexcept_if(__c)
2138#endif
2139
2140/*
2141 * nodiscard attribute added in C++17 and C23, but supported by both LLVM and
2142 * GCC in earlier language versions, so we use __has_c{,pp}_attribute to test
2143 * for it.
2144 *
2145 * __nodiscard may be used on a function:
2146 * __nodiscard int f();
2147 *
2148 * or on a struct, union or enum:
2149 * struct __nodiscard S{};
2150 * struct S f();
2151 *
2152 * or in C++, on an object constructor.
2153 */
2154
2155#if defined(__cplusplus) && defined(__has_cpp_attribute)
2156#if __has_cpp_attribute(nodiscard)
2157#define __nodiscard [[nodiscard]]
2158#endif
2159#elif defined(__STDC_VERSION__) && defined(__has_c_attribute)
2160#if __has_c_attribute(__nodiscard__)
2161#define __nodiscard [[__nodiscard__]]
2162#endif
2163#endif
2164
2165#ifndef __nodiscard
2166/*
2167 * LLVM 16 and earlier don't support [[nodiscard]] in C, but they do support
2168 * __warn_unused_result__ with the same semantics, so fall back to that.
2169 * We can't do this for GCC because the semantics are different.
2170 */
2171#ifdef __clang__
2172#define __nodiscard __attribute__((__warn_unused_result__))
2173#else
2174#define __nodiscard
2175#endif
2176#endif
2177
2178/*
2179 * We use `__restrict' as a way to define the `restrict' type qualifier
2180 * without disturbing older software that is unaware of C99 keywords.
2181 * GCC also provides `__restrict' as an extension to support C99-style
2182 * restricted pointers in other language modes.
2183 */
2184#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
2185#define __restrict restrict
2186#endif
2187
2188/*
2189 * All modern compilers have explicit branch prediction so that the CPU back-end
2190 * can hint to the processor and also so that code blocks can be reordered such
2191 * that the predicted path sees a more linear flow, thus improving cache
2192 * behavior, etc. Use sparingly, except in performance critical code where
2193 * they make things measurably faster.
2194 */
2195#define __predict_true(exp) __builtin_expect((exp), 1)
2196#define __predict_false(exp) __builtin_expect((exp), 0)
2197
2198#define __null_sentinel __attribute__((__sentinel__))
2199#define __exported __attribute__((__visibility__("default")))
2200#define __hidden __attribute__((__visibility__("hidden")))
2201
2202/*
2203 * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
2204 * require it.
2205 */
2206#define __offsetof(type, field) __builtin_offsetof(type, field)
2207#define __rangeof(type, start, end) \
2208 (__offsetof(type, end) - __offsetof(type, start))
2209
2210/*
2211 * Given the pointer x to the member m of the struct s, return
2212 * a pointer to the containing structure. When using GCC, we first
2213 * assign pointer x to a local variable, to check that its type is
2214 * compatible with member m.
2215 */
2216#define __containerof(x, s, m) ({ \
2217 const volatile __typeof(((s *)0)->m) *__x = (x); \
2218 __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
2219})
2220
2221/*
2222 * Compiler-dependent macros to declare that functions take printf-like
2223 * or scanf-like arguments.
2224 */
2225#define __printflike(fmtarg, firstvararg) \
2226 __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
2227#define __scanflike(fmtarg, firstvararg) \
2228 __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
2229#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
2230#define __strfmonlike(fmtarg, firstvararg) \
2231 __attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
2232#define __strftimelike(fmtarg, firstvararg) \
2233 __attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
2234
2235/*
2236 * Like __printflike, but allows fmtarg to be NULL. FreeBSD invented 'printf0'
2237 * for this because older versions of gcc issued warnings for NULL first args.
2238 * Clang has always had printf and printf0 as aliases. gcc 11.0 now follows
2239 * clang. So now this is an alias for __printflike, or nothing. In the future
2240 * _Nullable or _Nonnull will replace this.
2241 * XXX Except that doesn't work, so for now revert to printf0 for clang and
2242 * the FreeBSD gcc until I can work this out.
2243 */
2244#if defined(__clang__) || (defined(__GNUC__) && defined (__FreeBSD_cc_version))
2245#define __printf0like(fmtarg, firstvararg) \
2246 __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
2247#else
2248#define __printf0like(fmtarg, firstvararg)
2249#endif
2250
2251#define __strong_reference(sym,aliassym) \
2252 extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
2253#ifdef __STDC__
2254#define __weak_reference(sym,alias) \
2255 __asm__(".weak " #alias); \
2256 __asm__(".equ " #alias ", " #sym)
2257#define __warn_references(sym,msg) \
2258 __asm__(".section .gnu.warning." #sym); \
2259 __asm__(".asciz \"" msg "\""); \
2260 __asm__(".previous")
2261#ifdef __CC_SUPPORTS_SYMVER
2262#define __sym_compat(sym,impl,verid) \
2263 __asm__(".symver " #impl ", " #sym "@" #verid)
2264#define __sym_default(sym,impl,verid) \
2265 __asm__(".symver " #impl ", " #sym "@@@" #verid)
2266#endif
2267#else
2268#define __weak_reference(sym,alias) \
2269 __asm__(".weak alias"); \
2270 __asm__(".equ alias, sym")
2271#define __warn_references(sym,msg) \
2272 __asm__(".section .gnu.warning.sym"); \
2273 __asm__(".asciz \"msg\""); \
2274 __asm__(".previous")
2275#ifdef __CC_SUPPORTS_SYMVER
2276#define __sym_compat(sym,impl,verid) \
2277 __asm__(".symver impl, sym@verid")
2278#define __sym_default(impl,sym,verid) \
2279 __asm__(".symver impl, sym@@@verid")
2280#endif
2281#endif /* __STDC__ */
2282
2283#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym))
2284#define __WEAK(sym) __asm__(".weak " __XSTRING(sym))
2285
2286#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
2287
2288/*
2289 * Embed the rcs id of a source file in the resulting library. Note that in
2290 * more recent ELF binutils, we use .ident allowing the ID to be stripped.
2291 * Usage:
2292 */
2293#ifndef __FBSDID
2294#if !defined(STRIP_FBSDID)
2295#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
2296#else
2297#define __FBSDID(s) struct __hack
2298#endif
2299#endif
2300
2301#ifndef __RCSID
2302#ifndef NO__RCSID
2303#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
2304#else
2305#define __RCSID(s) struct __hack
2306#endif
2307#endif
2308
2309#ifndef __RCSID_SOURCE
2310#ifndef NO__RCSID_SOURCE
2311#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
2312#else
2313#define __RCSID_SOURCE(s) struct __hack
2314#endif
2315#endif
2316
2317#ifndef __SCCSID
2318#ifndef NO__SCCSID
2319#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
2320#else
2321#define __SCCSID(s) struct __hack
2322#endif
2323#endif
2324
2325#ifndef __COPYRIGHT
2326#ifndef NO__COPYRIGHT
2327#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
2328#else
2329#define __COPYRIGHT(s) struct __hack
2330#endif
2331#endif
2332
2333#ifndef __DECONST
2334#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
2335#endif
2336
2337#ifndef __DEVOLATILE
2338#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
2339#endif
2340
2341#ifndef __DEQUALIFY
2342#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
2343#endif
2344
2345#if !defined(_STANDALONE) && !defined(_KERNEL)
2346#define __RENAME(x) __asm(__STRING(x))
2347#else /* _STANDALONE || _KERNEL */
2348#define __RENAME(x) no renaming in kernel/standalone environment
2349#endif
2350
2351/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2352/*
2353 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
2354 *
2355 * Redistribution and use in source and binary forms, with or without
2356 * modification, are permitted provided that the following conditions
2357 * are met:
2358 * 1. Redistributions of source code must retain the above copyright
2359 * notice, this list of conditions and the following disclaimer.
2360 * 2. Redistributions in binary form must reproduce the above copyright
2361 * notice, this list of conditions and the following disclaimer in the
2362 * documentation and/or other materials provided with the distribution.
2363 * 3. The name of the author may not be used to endorse or promote products
2364 * derived from this software without specific prior written permission.
2365 *
2366 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2367 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2368 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2369 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2370 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2371 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2372 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2373 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2374 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2375 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2376 */
2377#ifndef EVENT2_VISIBILITY_H_INCLUDED_
2378#define EVENT2_VISIBILITY_H_INCLUDED_
2379
2380/* event2/event-config.h
2381 *
2382 * This file was generated by autoconf when libevent was built, and post-
2383 * processed by Libevent so that its macros would have a uniform prefix.
2384 *
2385 * DO NOT EDIT THIS FILE.
2386 *
2387 * Do not rely on macros in this file existing in later versions.
2388 */
2389#ifndef _EVENT_CONFIG_H_
2390#define _EVENT_CONFIG_H_
2391/* config.h. Generated by configure. */
2392/* config.h.in. Generated from configure.in by autoheader. */
2393
2394/* Define if libevent should not allow replacing the mm functions */
2395/* #undef _EVENT_DISABLE_MM_REPLACEMENT */
2396
2397/* Define if libevent should not be compiled with thread support */
2398/* #undef _EVENT_DISABLE_THREAD_SUPPORT */
2399
2400/* Define if clock_gettime is available in libc */
2401/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */
2402
2403/* Define is no secure id variant is available */
2404/* #define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
2405#define _EVENT_DNS_USE_FTIME_FOR_ID 1
2406
2407/* Define to 1 if you have the <arpa/inet.h> header file. */
2408/* #undef _EVENT_HAVE_ARPA_INET_H */
2409
2410/* Define to 1 if you have the `clock_gettime' function. */
2411/* #undef _EVENT_HAVE_CLOCK_GETTIME */
2412
2413/* Define if /dev/poll is available */
2414/* #undef _EVENT_HAVE_DEVPOLL */
2415
2416/* Define to 1 if you have the <dlfcn.h> header file. */
2417/* #undef _EVENT_HAVE_DLFCN_H */
2418
2419/* Define if your system supports the epoll system calls */
2420/* #undef _EVENT_HAVE_EPOLL */
2421
2422/* Define to 1 if you have the `epoll_ctl' function. */
2423/* #undef _EVENT_HAVE_EPOLL_CTL */
2424
2425/* Define to 1 if you have the `eventfd' function. */
2426/* #undef _EVENT_HAVE_EVENTFD */
2427
2428/* Define if your system supports event ports */
2429/* #undef _EVENT_HAVE_EVENT_PORTS */
2430
2431/* Define to 1 if you have the `fcntl' function. */
2432/* #undef _EVENT_HAVE_FCNTL */
2433
2434/* Define to 1 if you have the <fcntl.h> header file. */
2435#define _EVENT_HAVE_FCNTL_H 1
2436
2437/* Define to 1 if you have the `getaddrinfo' function. */
2438#define _EVENT_HAVE_GETADDRINFO 1
2439
2440/* Define to 1 if you have the `getnameinfo' function. */
2441#define _EVENT_HAVE_GETNAMEINFO 1
2442
2443/* Define to 1 if you have the `getprotobynumber' function. */
2444#define _EVENT_HAVE_GETPROTOBYNUMBER 1
2445
2446/* Define to 1 if you have the `getservbyname' function. */
2447#define _EVENT_HAVE_GETSERVBYNAME 1
2448
2449/* Define to 1 if you have the `gettimeofday' function. */
2450/* #define _EVENT_HAVE_GETTIMEOFDAY 1 */
2451
2452/* Define to 1 if you have the `inet_aton' function. */
2453/* #undef _EVENT_HAVE_INET_ATON */
2454
2455/* Define to 1 if you have the `inet_ntop' function. */
2456/* #undef _EVENT_HAVE_INET_NTOP */
2457
2458/* Define to 1 if you have the `inet_pton' function. */
2459/* #undef _EVENT_HAVE_INET_PTON */
2460
2461/* Define to 1 if you have the <inttypes.h> header file. */
2462/* #define _EVENT_HAVE_INTTYPES_H 1 */
2463
2464/* Define to 1 if you have the `kqueue' function. */
2465/* #undef _EVENT_HAVE_KQUEUE */
2466
2467/* Define if the system has zlib */
2468/* #undef _EVENT_HAVE_LIBZ */
2469
2470/* Define to 1 if you have the <memory.h> header file. */
2471#define _EVENT_HAVE_MEMORY_H 1
2472
2473/* Define to 1 if you have the `mmap' function. */
2474/* #undef _EVENT_HAVE_MMAP */
2475
2476/* Define to 1 if you have the <netinet/in6.h> header file. */
2477/* #undef _EVENT_HAVE_NETINET_IN6_H */
2478
2479/* Define to 1 if you have the <netinet/in.h> header file. */
2480/* #undef _EVENT_HAVE_NETINET_IN_H */
2481
2482/* Define to 1 if you have the `pipe' function. */
2483/* #undef _EVENT_HAVE_PIPE */
2484
2485/* Define to 1 if you have the `poll' function. */
2486/* #undef _EVENT_HAVE_POLL */
2487
2488/* Define to 1 if you have the <poll.h> header file. */
2489/* #undef _EVENT_HAVE_POLL_H */
2490
2491/* Define to 1 if you have the `port_create' function. */
2492/* #undef _EVENT_HAVE_PORT_CREATE */
2493
2494/* Define to 1 if you have the <port.h> header file. */
2495/* #undef _EVENT_HAVE_PORT_H */
2496
2497/* Define if you have POSIX threads libraries and header files. */
2498/* #undef _EVENT_HAVE_PTHREAD */
2499
2500/* Define if we have pthreads on this system */
2501/* #undef _EVENT_HAVE_PTHREADS */
2502
2503/* Define to 1 if the system has the type `sa_family_t'. */
2504/* #undef _EVENT_HAVE_SA_FAMILY_T */
2505
2506/* Define to 1 if you have the `select' function. */
2507/* #undef _EVENT_HAVE_SELECT */
2508
2509/* Define to 1 if you have the `sendfile' function. */
2510/* #undef _EVENT_HAVE_SENDFILE */
2511
2512/* Define if F_SETFD is defined in <fcntl.h> */
2513/* #undef _EVENT_HAVE_SETFD */
2514
2515/* Define to 1 if you have the `sigaction' function. */
2516/* #undef _EVENT_HAVE_SIGACTION */
2517
2518/* Define to 1 if you have the `signal' function. */
2519#define _EVENT_HAVE_SIGNAL 1
2520
2521/* Define to 1 if you have the `splice' function. */
2522/* #undef _EVENT_HAVE_SPLICE */
2523
2524/* Define to 1 if you have the <stdarg.h> header file. */
2525#define _EVENT_HAVE_STDARG_H 1
2526
2527/* Define to 1 if you have the <stddef.h> header file. */
2528#define _EVENT_HAVE_STDDEF_H 1
2529
2530/* Define to 1 if you have the <stdint.h> header file. */
2531/* #define _EVENT_HAVE_STDINT_H 1 */
2532
2533/* Define to 1 if you have the <stdlib.h> header file. */
2534#define _EVENT_HAVE_STDLIB_H 1
2535
2536/* Define to 1 if you have the <strings.h> header file. */
2537#define _EVENT_HAVE_STRINGS_H 1
2538
2539/* Define to 1 if you have the <string.h> header file. */
2540#define _EVENT_HAVE_STRING_H 1
2541
2542/* Define to 1 if you have the `strlcpy' function. */
2543/* #undef _EVENT_HAVE_STRLCPY */
2544
2545/* Define to 1 if you have the `strsep' function. */
2546/* #undef _EVENT_HAVE_STRSEP */
2547
2548/* Define to 1 if you have the `strtok_r' function. */
2549/* #undef _EVENT_HAVE_STRTOK_R */
2550
2551/* Define to 1 if you have the `strtoll' function. */
2552/* #define _EVENT_HAVE_STRTOLL 1 */
2553
2554#define _EVENT_HAVE_STRUCT_ADDRINFO 1
2555
2556/* Define to 1 if the system has the type `struct in6_addr'. */
2557#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
2558
2559/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
2560#define _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
2561
2562/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
2563#define _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
2564
2565/* Define to 1 if the system has the type `struct sockaddr_in6'. */
2566#define _EVENT_HAVE_STRUCT_SOCKADDR_IN6 1
2567
2568/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
2569/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
2570
2571/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
2572/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
2573
2574/* Define to 1 if the system has the type `struct sockaddr_storage'. */
2575#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE 1
2576
2577/* Define to 1 if you have the <sys/devpoll.h> header file. */
2578/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
2579
2580/* Define to 1 if you have the <sys/epoll.h> header file. */
2581/* #undef _EVENT_HAVE_SYS_EPOLL_H */
2582
2583/* Define to 1 if you have the <sys/eventfd.h> header file. */
2584/* #undef _EVENT_HAVE_SYS_EVENTFD_H */
2585
2586/* Define to 1 if you have the <sys/event.h> header file. */
2587/* #undef _EVENT_HAVE_SYS_EVENT_H */
2588
2589/* Define to 1 if you have the <sys/ioctl.h> header file. */
2590/* #undef _EVENT_HAVE_SYS_IOCTL_H */
2591
2592/* Define to 1 if you have the <sys/mman.h> header file. */
2593/* #undef _EVENT_HAVE_SYS_MMAN_H */
2594
2595/* Define to 1 if you have the <sys/param.h> header file. */
2596/* #define _EVENT_HAVE_SYS_PARAM_H 1 */
2597
2598/* Define to 1 if you have the <sys/queue.h> header file. */
2599/* #undef _EVENT_HAVE_SYS_QUEUE_H */
2600
2601/* Define to 1 if you have the <sys/select.h> header file. */
2602/* #undef _EVENT_HAVE_SYS_SELECT_H */
2603
2604/* Define to 1 if you have the <sys/sendfile.h> header file. */
2605/* #undef _EVENT_HAVE_SYS_SENDFILE_H */
2606
2607/* Define to 1 if you have the <sys/socket.h> header file. */
2608/* #undef _EVENT_HAVE_SYS_SOCKET_H */
2609
2610/* Define to 1 if you have the <sys/stat.h> header file. */
2611#define _EVENT_HAVE_SYS_STAT_H 1
2612
2613/* Define to 1 if you have the <sys/time.h> header file. */
2614/* #define _EVENT_HAVE_SYS_TIME_H 1 */
2615
2616/* Define to 1 if you have the <sys/types.h> header file. */
2617#define _EVENT_HAVE_SYS_TYPES_H 1
2618
2619/* Define to 1 if you have the <sys/uio.h> header file. */
2620/* #undef _EVENT_HAVE_SYS_UIO_H */
2621
2622/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
2623/* #undef _EVENT_HAVE_TAILQFOREACH */
2624
2625/* Define if timeradd is defined in <sys/time.h> */
2626/* #undef _EVENT_HAVE_TIMERADD */
2627
2628/* Define if timerclear is defined in <sys/time.h> */
2629#define _EVENT_HAVE_TIMERCLEAR 1
2630
2631/* Define if timercmp is defined in <sys/time.h> */
2632#define _EVENT_HAVE_TIMERCMP 1
2633
2634/* Define if timerisset is defined in <sys/time.h> */
2635#define _EVENT_HAVE_TIMERISSET 1
2636
2637/* Define to 1 if the system has the type `uint16_t'. */
2638/* #define _EVENT_HAVE_UINT16_T 1 */
2639
2640/* Define to 1 if the system has the type `uint32_t'. */
2641/* #define _EVENT_HAVE_UINT32_T 1 */
2642
2643/* Define to 1 if the system has the type `uint64_t'. */
2644/* #define _EVENT_HAVE_UINT64_T 1 */
2645
2646/* Define to 1 if the system has the type `uint8_t'. */
2647/* #define _EVENT_HAVE_UINT8_T 1 */
2648
2649/* Define to 1 if you have the <unistd.h> header file. */
2650/* #define _EVENT_HAVE_UNISTD_H 1 */
2651
2652/* Define to 1 if you have the `vasprintf' function. */
2653/* #undef _EVENT_HAVE_VASPRINTF */
2654
2655/* Define if kqueue works correctly with pipes */
2656/* #undef _EVENT_HAVE_WORKING_KQUEUE */
2657
2658/* Numeric representation of the version */
2659#define _EVENT_NUMERIC_VERSION 0x02001500
2660
2661/* Name of package */
2662#define _EVENT_PACKAGE "libevent"
2663
2664/* Define to the address where bug reports for this package should be sent. */
2665#define _EVENT_PACKAGE_BUGREPORT ""
2666
2667/* Define to the full name of this package. */
2668#define _EVENT_PACKAGE_NAME ""
2669
2670/* Define to the full name and version of this package. */
2671#define _EVENT_PACKAGE_STRING ""
2672
2673/* Define to the one symbol short name of this package. */
2674#define _EVENT_PACKAGE_TARNAME ""
2675
2676/* Define to the version of this package. */
2677#define _EVENT_PACKAGE_VERSION ""
2678
2679/* Define to necessary symbol if this constant uses a non-standard name on
2680 your system. */
2681/* #undef _EVENT_PTHREAD_CREATE_JOINABLE */
2682
2683/* The size of a `int', as computed by sizeof. */
2684#define _EVENT_SIZEOF_INT 4
2685
2686/* The size of a `long', as computed by sizeof. */
2687#define _EVENT_SIZEOF_LONG 4
2688
2689/* The size of a `long long', as computed by sizeof. */
2690#define _EVENT_SIZEOF_LONG_LONG 8
2691
2692/* The size of a `short', as computed by sizeof. */
2693#define _EVENT_SIZEOF_SHORT 2
2694
2695/* The size of `size_t', as computed by sizeof. */
2696#ifdef _WIN64
2697#define _EVENT_SIZEOF_SIZE_T 8
2698#else
2699#define _EVENT_SIZEOF_SIZE_T 4
2700#endif
2701
2702/* The size of `void *', as computed by sizeof. */
2703#ifdef _WIN64
2704#define _EVENT_SIZEOF_VOID_P 8
2705#else
2706#define _EVENT_SIZEOF_VOID_P 4
2707#endif
2708
2709/* Define to 1 if you have the ANSI C header files. */
2710#define _EVENT_STDC_HEADERS 1
2711
2712/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
2713#define _EVENT_TIME_WITH_SYS_TIME 1
2714
2715/* Version number of package */
2716#define _EVENT_VERSION "2.0.21-stable"
2717
2718/* Define to appropriate substitue if compiler doesnt have __func__ */
2719#define _EVENT___func__ __FUNCTION__
2720
2721/* Define to empty if `const' does not conform to ANSI C. */
2722/* #undef _EVENT_const */
2723
2724/* Define to `__inline__' or `__inline' if that's what the C compiler
2725 calls it, or to nothing if 'inline' is not supported under any name. */
2726#ifndef _EVENT___cplusplus
2727#define _EVENT_inline __inline
2728#endif
2729
2730/* Define to `int' if <sys/types.h> does not define. */
2731/* #undef _EVENT_pid_t */
2732
2733/* Define to `unsigned' if <sys/types.h> does not define. */
2734/* #undef _EVENT_size_t */
2735
2736/* Define to unsigned int if you dont have it */
2737#define _EVENT_socklen_t unsigned int
2738
2739/* Define to `int' if <sys/types.h> does not define. */
2740#define _EVENT_ssize_t SSIZE_T
2741
2742#endif
2743
2744#if defined(event_shared_EXPORTS) || \
2745 defined(event_extra_shared_EXPORTS) || \
2746 defined(event_core_shared_EXPORTS) || \
2747 defined(event_pthreads_shared_EXPORTS) || \
2748 defined(event_openssl_shared_EXPORTS) || \
2749 defined(event_mbedtls_shared_EXPORTS)
2750
2751# if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
2752# define EVENT2_EXPORT_SYMBOL __global
2753# elif defined __GNUC__
2754# define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default")))
2755# elif defined(_MSC_VER)
2756# define EVENT2_EXPORT_SYMBOL __declspec(dllexport)
2757# else
2758# define EVENT2_EXPORT_SYMBOL /* unknown compiler */
2759# endif
2760
2761#else /* event_*_EXPORTS */
2762
2763# define EVENT2_EXPORT_SYMBOL
2764
2765#endif /* event_*_EXPORTS */
2766
2767/** We need to dllimport event_debug_logging_mask_ into event_extra */
2768#if defined(_MSC_VER)
2769# if defined(event_core_shared_EXPORTS) /** from core export */
2770# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllexport)
2771# elif defined(event_extra_shared_EXPORTS) || /** from extra import */ \
2772 defined(EVENT_VISIBILITY_WANT_DLLIMPORT)
2773# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllimport)
2774# endif
2775#endif /* _MSC_VER */
2776#if !defined(EVENT2_CORE_EXPORT_SYMBOL)
2777# define EVENT2_CORE_EXPORT_SYMBOL EVENT2_EXPORT_SYMBOL
2778#endif
2779
2780#endif /* EVENT2_VISIBILITY_H_INCLUDED_ */
2781
2782/*
2783 * Nullability qualifiers: currently only supported by Clang.
2784 */
2785#if !(defined(__clang__) && __has_feature(nullability))
2786#define _Nonnull
2787#define _Nullable
2788#define _Null_unspecified
2789#define __NULLABILITY_PRAGMA_PUSH
2790#define __NULLABILITY_PRAGMA_POP
2791#else
2792#define __NULLABILITY_PRAGMA_PUSH _Pragma("clang diagnostic push") \
2793 _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
2794#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop")
2795#endif
2796
2797/*
2798 * Type Safety Checking
2799 *
2800 * Clang provides additional attributes to enable checking type safety
2801 * properties that cannot be enforced by the C type system.
2802 */
2803
2804#if __has_attribute(__argument_with_type_tag__) && \
2805 __has_attribute(__type_tag_for_datatype__)
2806#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
2807 __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
2808#define __datatype_type_tag(kind, type) \
2809 __attribute__((__type_tag_for_datatype__(kind, type)))
2810#else
2811#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
2812#define __datatype_type_tag(kind, type)
2813#endif
2814
2815/*
2816 * Lock annotations.
2817 *
2818 * Clang provides support for doing basic thread-safety tests at
2819 * compile-time, by marking which locks will/should be held when
2820 * entering/leaving a functions.
2821 *
2822 * Furthermore, it is also possible to annotate variables and structure
2823 * members to enforce that they are only accessed when certain locks are
2824 * held.
2825 */
2826
2827#if __has_extension(c_thread_safety_attributes)
2828#define __lock_annotate(x) __attribute__((x))
2829#else
2830#define __lock_annotate(x)
2831#endif
2832
2833/* Structure implements a lock. */
2834#define __lockable __lock_annotate(lockable)
2835
2836/* Function acquires an exclusive or shared lock. */
2837#define __locks_exclusive(...) \
2838 __lock_annotate(exclusive_lock_function(__VA_ARGS__))
2839#define __locks_shared(...) \
2840 __lock_annotate(shared_lock_function(__VA_ARGS__))
2841
2842/* Function attempts to acquire an exclusive or shared lock. */
2843#define __trylocks_exclusive(...) \
2844 __lock_annotate(exclusive_trylock_function(__VA_ARGS__))
2845#define __trylocks_shared(...) \
2846 __lock_annotate(shared_trylock_function(__VA_ARGS__))
2847
2848/* Function releases a lock. */
2849#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__))
2850
2851/* Function asserts that an exclusive or shared lock is held. */
2852#define __asserts_exclusive(...) \
2853 __lock_annotate(assert_exclusive_lock(__VA_ARGS__))
2854#define __asserts_shared(...) \
2855 __lock_annotate(assert_shared_lock(__VA_ARGS__))
2856
2857/* Function requires that an exclusive or shared lock is or is not held. */
2858#define __requires_exclusive(...) \
2859 __lock_annotate(exclusive_locks_required(__VA_ARGS__))
2860#define __requires_shared(...) \
2861 __lock_annotate(shared_locks_required(__VA_ARGS__))
2862#define __requires_unlocked(...) \
2863 __lock_annotate(locks_excluded(__VA_ARGS__))
2864
2865/* Function should not be analyzed. */
2866#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis)
2867
2868/*
2869 * Function or variable should not be sanitized, e.g., by AddressSanitizer.
2870 * GCC has the nosanitize attribute, but as a function attribute only, and
2871 * warns on use as a variable attribute.
2872 */
2873#if __has_feature(address_sanitizer) && defined(__clang__)
2874#ifdef _KERNEL
2875#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address")))
2876#else
2877#define __nosanitizeaddress __attribute__((no_sanitize("address")))
2878#endif
2879#else
2880#define __nosanitizeaddress
2881#endif
2882#if __has_feature(coverage_sanitizer) && defined(__clang__)
2883#define __nosanitizecoverage __attribute__((no_sanitize("coverage")))
2884#else
2885#define __nosanitizecoverage
2886#endif
2887#if __has_feature(memory_sanitizer) && defined(__clang__)
2888#ifdef _KERNEL
2889#define __nosanitizememory __attribute__((no_sanitize("kernel-memory")))
2890#else
2891#define __nosanitizememory __attribute__((no_sanitize("memory")))
2892#endif
2893#else
2894#define __nosanitizememory
2895#endif
2896#if __has_feature(thread_sanitizer) && defined(__clang__)
2897#define __nosanitizethread __attribute__((no_sanitize("thread")))
2898#else
2899#define __nosanitizethread
2900#endif
2901
2902/*
2903 * Make it possible to opt out of stack smashing protection.
2904 */
2905#if __has_attribute(no_stack_protector)
2906#define __nostackprotector __attribute__((no_stack_protector))
2907#else
2908#define __nostackprotector \
2909 __attribute__((__optimize__("-fno-stack-protector")))
2910#endif
2911
2912/* Guard variables and structure members by lock. */
2913#define __guarded_by(x) __lock_annotate(guarded_by(x))
2914#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))
2915
2916/* Alignment builtins for better type checking and improved code generation. */
2917/* Provide fallback versions for other compilers (GCC/Clang < 10): */
2918#if !__has_builtin(__builtin_is_aligned)
2919#define __builtin_is_aligned(x, align) \
2920 (((__uintptr_t)(x) & ((align) - 1)) == 0)
2921#endif
2922#if !__has_builtin(__builtin_align_up)
2923#define __builtin_align_up(x, align) \
2924 ((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1))))
2925#endif
2926#if !__has_builtin(__builtin_align_down)
2927#define __builtin_align_down(x, align) \
2928 ((__typeof__(x))((x)&(~((align)-1))))
2929#endif
2930
2931#define __align_up(x, y) __builtin_align_up(x, y)
2932#define __align_down(x, y) __builtin_align_down(x, y)
2933#define __is_aligned(x, y) __builtin_is_aligned(x, y)
2934
2935#endif /* !_SYS_CDEFS_H_ */
2936
2937/* Define __gnuc_va_list. */
2938
2939#ifndef __GNUC_VA_LIST
2940#define __GNUC_VA_LIST
2941typedef __builtin_va_list __gnuc_va_list;
2942#endif
2943
2944/* Note that the type used in va_arg is supposed to match the
2945 actual type **after default promotions**.
2946 Thus, va_arg (..., short) is not valid. */
2947
2948#define va_start(ap, last) __builtin_va_start((ap), last)
2949#define va_end(ap) __builtin_va_end((ap))
2950#define va_arg(ap, type) __builtin_va_arg((ap), type)
2951#define __va_copy(dst, src) __builtin_va_copy((dst),(src))
2952
2953typedef __gnuc_va_list va_list;
2954
2955#if __ISO_C_VISIBLE >= 1999
2956#define va_copy(dst, src) __va_copy((dst), (src))
2957#endif
2958
2959#endif /* not _STDARG_H_ */
2960
2961// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
2962#ifndef va_end
2963#define va_end(ap) va_end (ap)
2964#endif
2965
2966namespace std
2967{
2968 using ::va_list;
2969} // namespace std
2970
2971#endif
2972
2973
2974 /*
2975 * <sys/reent.h> defines __sFILE, _fpos_t.
2976 * They must be defined there because struct _reent needs them (and we don't
2977 * want reent.h to include this file.
2978 */
2979
2980 struct __sFile
2981 {
2982 int unused;
2983 };
2984
2985 typedef struct __sFILE FILE;
2986
2987 #define __SLBF 0x0001 /* line buffered */
2988 #define __SNBF 0x0002 /* unbuffered */
2989 #define __SRD 0x0004 /* OK to read */
2990 #define __SWR 0x0008 /* OK to write */
2991 /* RD and WR are never simultaneously asserted */
2992 #define __SRW 0x0010 /* open for reading & writing */
2993 #define __SEOF 0x0020 /* found EOF */
2994 #define __SERR 0x0040 /* found error */
2995 #define __SMBF 0x0080 /* _buf is from malloc */
2996 #define __SAPP 0x0100 /* fdopen()ed in append mode - so must write to end */
2997 #define __SSTR 0x0200 /* this is an sprintf/snprintf string */
2998 #define __SOPT 0x0400 /* do fseek() optimisation */
2999 #define __SNPT 0x0800 /* do not do fseek() optimisation */
3000 #define __SOFF 0x1000 /* set iff _offset is in fact correct */
3001 #define __SMOD 0x2000 /* true => fgetline modified _p text */
3002 #if defined(__CYGWIN__) || defined(__CYGWIN__)
3003 #define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */
3004 #endif
3005
3006 /*
3007 * The following three definitions are for ANSI C, which took them
3008 * from System V, which stupidly took internal interface macros and
3009 * made them official arguments to setvbuf(), without renaming them.
3010 * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
3011 *
3012 * Although these happen to match their counterparts above, the
3013 * implementation does not rely on that (so these could be renumbered).
3014 */
3015 #define _IOFBF 0 /* setvbuf should set fully buffered */
3016 #define _IOLBF 1 /* setvbuf should set line buffered */
3017 #define _IONBF 2 /* setvbuf should set unbuffered */
3018
3019 #ifndef NULL
3020 #define NULL 0
3021 #endif
3022
3023 #define BUFSIZ 1024
3024 #define EOF (-1)
3025
3026 #define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
3027 #define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
3028 #define L_tmpnam 1024 /* XXX must be == PATH_MAX */
3029 #ifndef __STRICT_ANSI__
3030 #define P_tmpdir "/tmp"
3031 #endif
3032
3033 #ifndef SEEK_SET
3034 #define SEEK_SET 0 /* set file offset to offset */
3035 #endif
3036 #ifndef SEEK_CUR
3037 #define SEEK_CUR 1 /* set file offset to current plus offset */
3038 #endif
3039 #ifndef SEEK_END
3040 #define SEEK_END 2 /* set file offset to EOF plus offset */
3041 #endif
3042
3043 #define TMP_MAX 26
3044
3045 #define stdin (_impure_ptr->_stdin)
3046 #define stdout (_impure_ptr->_stdout)
3047 #define stderr (_impure_ptr->_stderr)
3048
3049 #define _stdin_r(x) ((x)->_stdin)
3050 #define _stdout_r(x) ((x)->_stdout)
3051 #define _stderr_r(x) ((x)->_stderr)
3052
3053 /*
3054 * Functions defined in ANSI C standard.
3055 */
3056
3057 #ifdef __GNUC__
3058 #define __VALIST __gnuc_va_list
3059 #else
3060 #define __VALIST char*
3061 #endif
3062
3063 #ifndef _EXFUN
3064 # define _EXFUN(N,P) N P
3065 #endif
3066
3067 int _EXFUN(printf, (const char *, ...));
3068 int _EXFUN(scanf, (const char *, ...));
3069 int _EXFUN(sscanf, (const char *, const char *, ...));
3070 int _EXFUN(vfprintf, (FILE *, const char *, __VALIST));
3071 int _EXFUN(vprintf, (const char *, __VALIST));
3072 int _EXFUN(vsprintf, (char *, const char *, __VALIST));
3073 int _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST));
3074 int _EXFUN(fgetc, (FILE *));
3075 char * _EXFUN(fgets, (char *, int, FILE *));
3076 int _EXFUN(fputc, (int, FILE *));
3077 int _EXFUN(fputs, (const char *, FILE *));
3078 int _EXFUN(getc, (FILE *));
3079 int _EXFUN(getchar, (void));
3080 char * _EXFUN(gets, (char *));
3081 int _EXFUN(putc, (int, FILE *));
3082 int _EXFUN(putchar, (int));
3083 int _EXFUN(puts, (const char *));
3084 int _EXFUN(ungetc, (int, FILE *));
3085 size_t _EXFUN(fread, (void *, size_t _size, size_t _n, FILE *));
3086 size_t _EXFUN(fwrite, (const void *, size_t _size, size_t _n, FILE *));
3087
3088 int _EXFUN(sprintf, (char *, const char *, ...));
3089 int _EXFUN(snprintf, (char *, size_t, const char *, ...));
3090
3091 #ifdef __cplusplus
3092 }
3093 #endif
3094int main(){
3095 int a,b;
3096 scanf("%d %d",&a,&b);
3097 printf("%d",a+b);
3098}
3099}}}
3100