summaryrefslogtreecommitdiffstats
path: root/gl/pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/pthread.h')
-rw-r--r--gl/pthread.h2612
1 files changed, 2612 insertions, 0 deletions
diff --git a/gl/pthread.h b/gl/pthread.h
new file mode 100644
index 00000000..62e1b503
--- /dev/null
+++ b/gl/pthread.h
@@ -0,0 +1,2612 @@
1/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2/* Implement the most essential subset of POSIX pthread.h.
3
4 Copyright (C) 2009-2025 Free Software Foundation, Inc.
5
6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of the
9 License, or (at your option) any later version.
10
11 This file is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18
19/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */
20
21#if __GNUC__ >= 3
22#pragma GCC system_header
23#endif
24
25
26#if defined _GL_ALREADY_INCLUDING_PTHREAD_H
27/* Special invocation convention:
28 On Android, we have a sequence of nested includes
29 <pthread.h> -> <time.h> -> <sys/time.h> -> <sys/select.h> ->
30 <signal.h> -> <pthread.h>.
31 In this situation, PTHREAD_COND_INITIALIZER is not yet defined,
32 therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc. */
33
34#include_next <pthread.h>
35
36#else
37/* Normal invocation convention. */
38
39#ifndef _GL_PTHREAD_H_
40
41#if 1
42
43# define _GL_ALREADY_INCLUDING_PTHREAD_H
44
45/* The include_next requires a split double-inclusion guard. */
46# include_next <pthread.h>
47
48# undef _GL_ALREADY_INCLUDING_PTHREAD_H
49
50#endif
51
52#ifndef _GL_PTHREAD_H_
53#define _GL_PTHREAD_H_
54
55/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK,
56 HAVE_RAW_DECL_*. */
57#if !_GL_CONFIG_H_INCLUDED
58 #error "Please include config.h first."
59#endif
60
61#define __need_system_stdlib_h
62#include <stdlib.h>
63#undef __need_system_stdlib_h
64
65
66/* The pthreads-win32 <pthread.h> defines a couple of broken macros. */
67#undef asctime_r
68#undef ctime_r
69#undef gmtime_r
70#undef localtime_r
71#undef rand_r
72#undef strtok_r
73
74#include <errno.h>
75#include <sched.h>
76#include <sys/types.h>
77#include <time.h>
78
79/* The __attribute__ feature is available in gcc versions 2.5 and later.
80 The attribute __pure__ was added in gcc 2.96. */
81#ifndef _GL_ATTRIBUTE_PURE
82# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
83# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
84# else
85# define _GL_ATTRIBUTE_PURE /* empty */
86# endif
87#endif
88
89/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
90/* C++ compatible function declaration macros.
91 Copyright (C) 2010-2025 Free Software Foundation, Inc.
92
93 This program is free software: you can redistribute it and/or modify it
94 under the terms of the GNU Lesser General Public License as published
95 by the Free Software Foundation; either version 2 of the License, or
96 (at your option) any later version.
97
98 This program is distributed in the hope that it will be useful,
99 but WITHOUT ANY WARRANTY; without even the implied warranty of
100 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
101 Lesser General Public License for more details.
102
103 You should have received a copy of the GNU Lesser General Public License
104 along with this program. If not, see <https://www.gnu.org/licenses/>. */
105
106#ifndef _GL_CXXDEFS_H
107#define _GL_CXXDEFS_H
108
109/* Begin/end the GNULIB_NAMESPACE namespace. */
110#if defined __cplusplus && defined GNULIB_NAMESPACE
111# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
112# define _GL_END_NAMESPACE }
113#else
114# define _GL_BEGIN_NAMESPACE
115# define _GL_END_NAMESPACE
116#endif
117
118/* The three most frequent use cases of these macros are:
119
120 * For providing a substitute for a function that is missing on some
121 platforms, but is declared and works fine on the platforms on which
122 it exists:
123
124 #if @GNULIB_FOO@
125 # if !@HAVE_FOO@
126 _GL_FUNCDECL_SYS (foo, ...);
127 # endif
128 _GL_CXXALIAS_SYS (foo, ...);
129 _GL_CXXALIASWARN (foo);
130 #elif defined GNULIB_POSIXCHECK
131 ...
132 #endif
133
134 * For providing a replacement for a function that exists on all platforms,
135 but is broken/insufficient and needs to be replaced on some platforms:
136
137 #if @GNULIB_FOO@
138 # if @REPLACE_FOO@
139 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
140 # undef foo
141 # define foo rpl_foo
142 # endif
143 _GL_FUNCDECL_RPL (foo, ...);
144 _GL_CXXALIAS_RPL (foo, ...);
145 # else
146 _GL_CXXALIAS_SYS (foo, ...);
147 # endif
148 _GL_CXXALIASWARN (foo);
149 #elif defined GNULIB_POSIXCHECK
150 ...
151 #endif
152
153 * For providing a replacement for a function that exists on some platforms
154 but is broken/insufficient and needs to be replaced on some of them and
155 is additionally either missing or undeclared on some other platforms:
156
157 #if @GNULIB_FOO@
158 # if @REPLACE_FOO@
159 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
160 # undef foo
161 # define foo rpl_foo
162 # endif
163 _GL_FUNCDECL_RPL (foo, ...);
164 _GL_CXXALIAS_RPL (foo, ...);
165 # else
166 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
167 _GL_FUNCDECL_SYS (foo, ...);
168 # endif
169 _GL_CXXALIAS_SYS (foo, ...);
170 # endif
171 _GL_CXXALIASWARN (foo);
172 #elif defined GNULIB_POSIXCHECK
173 ...
174 #endif
175*/
176
177/* _GL_EXTERN_C declaration;
178 performs the declaration with C linkage. */
179#if defined __cplusplus
180# define _GL_EXTERN_C extern "C"
181#else
182# define _GL_EXTERN_C extern
183#endif
184
185/* _GL_EXTERN_C_FUNC declaration;
186 performs the declaration of a function with C linkage. */
187#if defined __cplusplus
188# define _GL_EXTERN_C_FUNC extern "C"
189#else
190/* In C mode, omit the 'extern' keyword, because attributes in bracket syntax
191 are not allowed between 'extern' and the return type (see gnulib-common.m4).
192 */
193# define _GL_EXTERN_C_FUNC
194#endif
195
196/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]);
197 declares a replacement function, named rpl_func, with the given prototype,
198 consisting of return type, parameters, and attributes.
199 Although attributes are optional, the comma before them is required
200 for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
201 if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
202 at the end of the declaration.
203 Examples:
204 _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
205 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
206 _GL_ARG_NONNULL ((1)));
207
208 Note: Attributes, such as _GL_ATTRIBUTE_DEPRECATED, are supported in front
209 of a _GL_FUNCDECL_RPL invocation only in C mode, not in C++ mode. (That's
210 because
211 [[...]] extern "C" <declaration>;
212 is invalid syntax in C++.)
213 */
214#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
215 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
216#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
217 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
218
219/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
220 declares the system function, named func, with the given prototype,
221 consisting of return type, parameters, and attributes.
222 Although attributes are optional, the comma before them is required
223 for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
224 if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
225 at the end of the declaration.
226 Examples:
227 _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
228 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
229 */
230#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
231 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
232
233/* _GL_CXXALIAS_RPL (func, rettype, parameters);
234 declares a C++ alias called GNULIB_NAMESPACE::func
235 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
236 Example:
237 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
238
239 Wrapping rpl_func in an object with an inline conversion operator
240 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
241 actually used in the program. */
242#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
243 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
244#if defined __cplusplus && defined GNULIB_NAMESPACE
245# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
246 namespace GNULIB_NAMESPACE \
247 { \
248 static const struct _gl_ ## func ## _wrapper \
249 { \
250 typedef rettype (*type) parameters; \
251 \
252 inline operator type () const \
253 { \
254 return ::rpl_func; \
255 } \
256 } func = {}; \
257 } \
258 _GL_EXTERN_C int _gl_cxxalias_dummy
259#else
260# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
261 _GL_EXTERN_C int _gl_cxxalias_dummy
262#endif
263
264/* _GL_CXXALIAS_MDA (func, rettype, parameters);
265 is to be used when func is a Microsoft deprecated alias, on native Windows.
266 It declares a C++ alias called GNULIB_NAMESPACE::func
267 that redirects to _func, if GNULIB_NAMESPACE is defined.
268 Example:
269 _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
270 */
271#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
272 _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
273
274/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
275 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
276 except that the C function rpl_func may have a slightly different
277 declaration. A cast is used to silence the "invalid conversion" error
278 that would otherwise occur. */
279#if defined __cplusplus && defined GNULIB_NAMESPACE
280# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
281 namespace GNULIB_NAMESPACE \
282 { \
283 static const struct _gl_ ## func ## _wrapper \
284 { \
285 typedef rettype (*type) parameters; \
286 \
287 inline operator type () const \
288 { \
289 return reinterpret_cast<type>(::rpl_func); \
290 } \
291 } func = {}; \
292 } \
293 _GL_EXTERN_C int _gl_cxxalias_dummy
294#else
295# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
296 _GL_EXTERN_C int _gl_cxxalias_dummy
297#endif
298
299/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
300 is like _GL_CXXALIAS_MDA (func, rettype, parameters);
301 except that the C function func may have a slightly different declaration.
302 A cast is used to silence the "invalid conversion" error that would
303 otherwise occur. */
304#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
305 _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
306
307/* _GL_CXXALIAS_SYS (func, rettype, parameters);
308 declares a C++ alias called GNULIB_NAMESPACE::func
309 that redirects to the system provided function func, if GNULIB_NAMESPACE
310 is defined.
311 Example:
312 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
313
314 Wrapping func in an object with an inline conversion operator
315 avoids a reference to func unless GNULIB_NAMESPACE::func is
316 actually used in the program. */
317#if defined __cplusplus && defined GNULIB_NAMESPACE
318# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
319 namespace GNULIB_NAMESPACE \
320 { \
321 static const struct _gl_ ## func ## _wrapper \
322 { \
323 typedef rettype (*type) parameters; \
324 \
325 inline operator type () const \
326 { \
327 return ::func; \
328 } \
329 } func = {}; \
330 } \
331 _GL_EXTERN_C int _gl_cxxalias_dummy
332#else
333# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
334 _GL_EXTERN_C int _gl_cxxalias_dummy
335#endif
336
337/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
338 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
339 except that the C function func may have a slightly different declaration.
340 A cast is used to silence the "invalid conversion" error that would
341 otherwise occur. */
342#if defined __cplusplus && defined GNULIB_NAMESPACE
343# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
344 namespace GNULIB_NAMESPACE \
345 { \
346 static const struct _gl_ ## func ## _wrapper \
347 { \
348 typedef rettype (*type) parameters; \
349 \
350 inline operator type () const \
351 { \
352 return reinterpret_cast<type>(::func); \
353 } \
354 } func = {}; \
355 } \
356 _GL_EXTERN_C int _gl_cxxalias_dummy
357#else
358# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
359 _GL_EXTERN_C int _gl_cxxalias_dummy
360#endif
361
362/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
363 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
364 except that the C function is picked among a set of overloaded functions,
365 namely the one with rettype2 and parameters2. Two consecutive casts
366 are used to silence the "cannot find a match" and "invalid conversion"
367 errors that would otherwise occur. */
368#if defined __cplusplus && defined GNULIB_NAMESPACE
369 /* The outer cast must be a reinterpret_cast.
370 The inner cast: When the function is defined as a set of overloaded
371 functions, it works as a static_cast<>, choosing the designated variant.
372 When the function is defined as a single variant, it works as a
373 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
374# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
375 namespace GNULIB_NAMESPACE \
376 { \
377 static const struct _gl_ ## func ## _wrapper \
378 { \
379 typedef rettype (*type) parameters; \
380 \
381 inline operator type () const \
382 { \
383 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
384 } \
385 } func = {}; \
386 } \
387 _GL_EXTERN_C int _gl_cxxalias_dummy
388#else
389# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
390 _GL_EXTERN_C int _gl_cxxalias_dummy
391#endif
392
393/* _GL_CXXALIASWARN (func);
394 causes a warning to be emitted when ::func is used but not when
395 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
396 variants. */
397#if defined __cplusplus && defined GNULIB_NAMESPACE
398# define _GL_CXXALIASWARN(func) \
399 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
400# define _GL_CXXALIASWARN_1(func,namespace) \
401 _GL_CXXALIASWARN_2 (func, namespace)
402/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
403 we enable the warning only when not optimizing. */
404# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
405# define _GL_CXXALIASWARN_2(func,namespace) \
406 _GL_WARN_ON_USE (func, \
407 "The symbol ::" #func " refers to the system function. " \
408 "Use " #namespace "::" #func " instead.")
409# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
410# define _GL_CXXALIASWARN_2(func,namespace) \
411 extern __typeof__ (func) func
412# else
413# define _GL_CXXALIASWARN_2(func,namespace) \
414 _GL_EXTERN_C int _gl_cxxalias_dummy
415# endif
416#else
417# define _GL_CXXALIASWARN(func) \
418 _GL_EXTERN_C int _gl_cxxalias_dummy
419#endif
420
421/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
422 causes a warning to be emitted when the given overloaded variant of ::func
423 is used but not when GNULIB_NAMESPACE::func is used. */
424#if defined __cplusplus && defined GNULIB_NAMESPACE
425# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
426 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
427 GNULIB_NAMESPACE)
428# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
429 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
430/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
431 we enable the warning only when not optimizing. */
432# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
433# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
434 _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
435 "The symbol ::" #func " refers to the system function. " \
436 "Use " #namespace "::" #func " instead.")
437# else
438# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
439 _GL_EXTERN_C int _gl_cxxalias_dummy
440# endif
441#else
442# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
443 _GL_EXTERN_C int _gl_cxxalias_dummy
444#endif
445
446#endif /* _GL_CXXDEFS_H */
447
448/* The definition of _Noreturn is copied here. */
449/* A C macro for declaring that a function does not return.
450 Copyright (C) 2011-2025 Free Software Foundation, Inc.
451
452 This program is free software: you can redistribute it and/or modify it
453 under the terms of the GNU Lesser General Public License as published
454 by the Free Software Foundation; either version 2 of the License, or
455 (at your option) any later version.
456
457 This program is distributed in the hope that it will be useful,
458 but WITHOUT ANY WARRANTY; without even the implied warranty of
459 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
460 Lesser General Public License for more details.
461
462 You should have received a copy of the GNU Lesser General Public License
463 along with this program. If not, see <https://www.gnu.org/licenses/>. */
464
465/* The _Noreturn keyword of C11.
466 Do not use [[noreturn]], because with it the syntax
467 extern _Noreturn void func (...);
468 would not be valid; such a declaration would be valid only with 'extern'
469 and '_Noreturn' swapped, or without the 'extern' keyword. However, some
470 AIX system header files and several gnulib header files use precisely
471 this syntax with 'extern'. So even though C23 deprecates _Noreturn,
472 it is currently more portable to prefer it to [[noreturn]].
473
474 Also, do not try to work around LLVM bug 59792 (clang 15 or earlier).
475 This rare bug can be worked around by compiling with 'clang -D_Noreturn=',
476 though the workaround may generate many false-alarm warnings. */
477#ifndef _Noreturn
478# if ((!defined __cplusplus || defined __clang__) \
479 && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)))
480 /* _Noreturn works as-is. */
481# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
482 || 0x5110 <= __SUNPRO_C)
483 /* Prefer __attribute__ ((__noreturn__)) to plain _Noreturn even if the
484 latter works, as 'gcc -std=gnu99 -Wpedantic' warns about _Noreturn. */
485# define _Noreturn __attribute__ ((__noreturn__))
486# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
487# define _Noreturn __declspec (noreturn)
488# else
489# define _Noreturn
490# endif
491#endif
492
493/* The definition of _GL_ARG_NONNULL is copied here. */
494/* A C macro for declaring that specific arguments must not be NULL.
495 Copyright (C) 2009-2025 Free Software Foundation, Inc.
496
497 This program is free software: you can redistribute it and/or modify it
498 under the terms of the GNU Lesser General Public License as published
499 by the Free Software Foundation; either version 2 of the License, or
500 (at your option) any later version.
501
502 This program is distributed in the hope that it will be useful,
503 but WITHOUT ANY WARRANTY; without even the implied warranty of
504 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
505 Lesser General Public License for more details.
506
507 You should have received a copy of the GNU Lesser General Public License
508 along with this program. If not, see <https://www.gnu.org/licenses/>. */
509
510/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
511 that the values passed as arguments n, ..., m must be non-NULL pointers.
512 n = 1 stands for the first argument, n = 2 for the second argument etc. */
513#ifndef _GL_ARG_NONNULL
514# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
515# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
516# else
517# define _GL_ARG_NONNULL(params)
518# endif
519#endif
520
521/* The definition of _GL_WARN_ON_USE is copied here. */
522/* A C macro for emitting warnings if a function is used.
523 Copyright (C) 2010-2025 Free Software Foundation, Inc.
524
525 This program is free software: you can redistribute it and/or modify it
526 under the terms of the GNU Lesser General Public License as published
527 by the Free Software Foundation; either version 2 of the License, or
528 (at your option) any later version.
529
530 This program is distributed in the hope that it will be useful,
531 but WITHOUT ANY WARRANTY; without even the implied warranty of
532 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
533 Lesser General Public License for more details.
534
535 You should have received a copy of the GNU Lesser General Public License
536 along with this program. If not, see <https://www.gnu.org/licenses/>. */
537
538/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
539 for FUNCTION which will then trigger a compiler warning containing
540 the text of "literal string" anywhere that function is called, if
541 supported by the compiler. If the compiler does not support this
542 feature, the macro expands to an unused extern declaration.
543
544 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
545 attribute used in _GL_WARN_ON_USE. If the compiler does not support
546 this feature, it expands to empty.
547
548 These macros are useful for marking a function as a potential
549 portability trap, with the intent that "literal string" include
550 instructions on the replacement function that should be used
551 instead.
552 _GL_WARN_ON_USE is for functions with 'extern' linkage.
553 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
554 linkage.
555
556 _GL_WARN_ON_USE should not be used more than once for a given function
557 in a given compilation unit (because this may generate a warning even
558 if the function is never called).
559
560 However, one of the reasons that a function is a portability trap is
561 if it has the wrong signature. Declaring FUNCTION with a different
562 signature in C is a compilation error, so this macro must use the
563 same type as any existing declaration so that programs that avoid
564 the problematic FUNCTION do not fail to compile merely because they
565 included a header that poisoned the function. But this implies that
566 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
567 have a declaration. Use of this macro implies that there must not
568 be any other macro hiding the declaration of FUNCTION; but
569 undefining FUNCTION first is part of the poisoning process anyway
570 (although for symbols that are provided only via a macro, the result
571 is a compilation error rather than a warning containing
572 "literal string"). Also note that in C++, it is only safe to use if
573 FUNCTION has no overloads.
574
575 For an example, it is possible to poison 'getline' by:
576 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
577 [getline]) in configure.ac, which potentially defines
578 HAVE_RAW_DECL_GETLINE
579 - adding this code to a header that wraps the system <stdio.h>:
580 #undef getline
581 #if HAVE_RAW_DECL_GETLINE
582 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
583 "not universally present; use the gnulib module getline");
584 #endif
585
586 It is not possible to directly poison global variables. But it is
587 possible to write a wrapper accessor function, and poison that
588 (less common usage, like &environ, will cause a compilation error
589 rather than issue the nice warning, but the end result of informing
590 the developer about their portability problem is still achieved):
591 #if HAVE_RAW_DECL_ENVIRON
592 static char ***
593 rpl_environ (void) { return &environ; }
594 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
595 # undef environ
596 # define environ (*rpl_environ ())
597 #endif
598 or better (avoiding contradictory use of 'static' and 'extern'):
599 #if HAVE_RAW_DECL_ENVIRON
600 static char ***
601 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
602 rpl_environ (void) { return &environ; }
603 # undef environ
604 # define environ (*rpl_environ ())
605 #endif
606 */
607#ifndef _GL_WARN_ON_USE
608
609# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
610/* A compiler attribute is available in gcc versions 4.3.0 and later. */
611# define _GL_WARN_ON_USE(function, message) \
612_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
613# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
614 __attribute__ ((__warning__ (message)))
615# elif __clang_major__ >= 4
616/* Another compiler attribute is available in clang. */
617# define _GL_WARN_ON_USE(function, message) \
618_GL_WARN_EXTERN_C __typeof__ (function) function \
619 __attribute__ ((__diagnose_if__ (1, message, "warning")))
620# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
621 __attribute__ ((__diagnose_if__ (1, message, "warning")))
622# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
623/* Verify the existence of the function. */
624# define _GL_WARN_ON_USE(function, message) \
625_GL_WARN_EXTERN_C __typeof__ (function) function
626# define _GL_WARN_ON_USE_ATTRIBUTE(message)
627# else /* Unsupported. */
628# define _GL_WARN_ON_USE(function, message) \
629_GL_WARN_EXTERN_C int _gl_warn_on_use
630# define _GL_WARN_ON_USE_ATTRIBUTE(message)
631# endif
632#endif
633
634/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
635 is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
636 function is declared with the given prototype, consisting of return type,
637 parameters, and attributes.
638 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
639 not work in this case. */
640#ifndef _GL_WARN_ON_USE_CXX
641# if !defined __cplusplus
642# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
643 _GL_WARN_ON_USE (function, msg)
644# else
645# if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__
646/* A compiler attribute is available in gcc versions 4.3.0 and later. */
647# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
648extern rettype_gcc function parameters_and_attributes \
649 __attribute__ ((__warning__ (msg)))
650# elif __clang_major__ >= 4
651/* Another compiler attribute is available in clang. */
652# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
653extern rettype_clang function parameters_and_attributes \
654 __attribute__ ((__diagnose_if__ (1, msg, "warning")))
655# elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING
656/* Verify the existence of the function. */
657# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
658extern rettype_gcc function parameters_and_attributes
659# else /* Unsupported. */
660# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
661_GL_WARN_EXTERN_C int _gl_warn_on_use
662# endif
663# endif
664#endif
665
666/* _GL_WARN_EXTERN_C declaration;
667 performs the declaration with C linkage. */
668#ifndef _GL_WARN_EXTERN_C
669# if defined __cplusplus
670# define _GL_WARN_EXTERN_C extern "C"
671# else
672# define _GL_WARN_EXTERN_C extern
673# endif
674#endif
675
676/* =========== Thread types and macros =========== */
677
678#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
679# if 0
680# include "windows-thread.h"
681# if 1
682# define pthread_t rpl_pthread_t
683# define pthread_attr_t rpl_pthread_attr_t
684# endif
685# if !GNULIB_defined_pthread_thread_types
686typedef glwthread_thread_t pthread_t;
687typedef unsigned int pthread_attr_t;
688# define GNULIB_defined_pthread_thread_types 1
689# endif
690# else
691# if 1
692# define pthread_t rpl_pthread_t
693# define pthread_attr_t rpl_pthread_attr_t
694# endif
695# if !GNULIB_defined_pthread_thread_types
696typedef int pthread_t;
697typedef unsigned int pthread_attr_t;
698# define GNULIB_defined_pthread_thread_types 1
699# endif
700# endif
701# undef PTHREAD_CREATE_JOINABLE
702# undef PTHREAD_CREATE_DETACHED
703# define PTHREAD_CREATE_JOINABLE 0
704# define PTHREAD_CREATE_DETACHED 1
705#else
706# if !1
707# if !GNULIB_defined_pthread_thread_types
708typedef int pthread_t;
709typedef unsigned int pthread_attr_t;
710# define GNULIB_defined_pthread_thread_types 1
711# endif
712# endif
713# if !1
714# define PTHREAD_CREATE_JOINABLE 0
715# define PTHREAD_CREATE_DETACHED 1
716# endif
717#endif
718
719/* =========== Once-only control (initialization) types and macros ========== */
720
721#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
722# if 1
723# include "windows-once.h"
724# if 1
725# define pthread_once_t rpl_pthread_once_t
726# endif
727# if !GNULIB_defined_pthread_once_types
728typedef glwthread_once_t pthread_once_t;
729# define GNULIB_defined_pthread_once_types 1
730# endif
731# undef PTHREAD_ONCE_INIT
732# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT
733# else
734# if 1
735# define pthread_once_t rpl_pthread_once_t
736# endif
737# if !GNULIB_defined_pthread_once_types
738typedef int pthread_once_t;
739# define GNULIB_defined_pthread_once_types 1
740# endif
741# undef PTHREAD_ONCE_INIT
742# define PTHREAD_ONCE_INIT { 0 }
743# endif
744#else
745# if !1
746# if !GNULIB_defined_pthread_once_types
747typedef int pthread_once_t;
748# define GNULIB_defined_pthread_once_types 1
749# endif
750# undef PTHREAD_ONCE_INIT
751# define PTHREAD_ONCE_INIT { 0 }
752# endif
753#endif
754
755/* =========== Mutex types and macros =========== */
756
757#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
758# if 0
759# include "windows-timedmutex.h"
760# include "windows-timedrecmutex.h"
761# if 1
762# define pthread_mutex_t rpl_pthread_mutex_t
763# define pthread_mutexattr_t rpl_pthread_mutexattr_t
764# endif
765# if !GNULIB_defined_pthread_mutex_types
766typedef struct
767 {
768 int type;
769 union
770 {
771 glwthread_timedmutex_t u_timedmutex;
772 glwthread_timedrecmutex_t u_timedrecmutex;
773 }
774 u;
775 }
776 pthread_mutex_t;
777typedef unsigned int pthread_mutexattr_t;
778# define GNULIB_defined_pthread_mutex_types 1
779# endif
780# undef PTHREAD_MUTEX_INITIALIZER
781# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } }
782# else
783# if 1
784# define pthread_mutex_t rpl_pthread_mutex_t
785# define pthread_mutexattr_t rpl_pthread_mutexattr_t
786# endif
787# if !GNULIB_defined_pthread_mutex_types
788typedef int pthread_mutex_t;
789typedef unsigned int pthread_mutexattr_t;
790# define GNULIB_defined_pthread_mutex_types 1
791# endif
792# undef PTHREAD_MUTEX_INITIALIZER
793# define PTHREAD_MUTEX_INITIALIZER { 0 }
794# endif
795# undef PTHREAD_MUTEX_DEFAULT
796# undef PTHREAD_MUTEX_NORMAL
797# undef PTHREAD_MUTEX_ERRORCHECK
798# undef PTHREAD_MUTEX_RECURSIVE
799# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
800# define PTHREAD_MUTEX_NORMAL 0
801# define PTHREAD_MUTEX_ERRORCHECK 1
802# define PTHREAD_MUTEX_RECURSIVE 2
803# undef PTHREAD_MUTEX_STALLED
804# undef PTHREAD_MUTEX_ROBUST
805# define PTHREAD_MUTEX_STALLED 0
806# define PTHREAD_MUTEX_ROBUST 1
807#else
808# if !1
809# if !GNULIB_defined_pthread_mutex_types
810typedef int pthread_mutex_t;
811typedef unsigned int pthread_mutexattr_t;
812# define GNULIB_defined_pthread_mutex_types 1
813# endif
814# undef PTHREAD_MUTEX_INITIALIZER
815# define PTHREAD_MUTEX_INITIALIZER { 0 }
816# endif
817# if !1
818# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
819# define PTHREAD_MUTEX_NORMAL 0
820# define PTHREAD_MUTEX_ERRORCHECK 1
821# define PTHREAD_MUTEX_RECURSIVE 2
822# endif
823# if !1
824# define PTHREAD_MUTEX_STALLED 0
825# define PTHREAD_MUTEX_ROBUST 1
826# endif
827#endif
828
829/* =========== Read-write lock types and macros =========== */
830
831#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
832# if 0
833# include "windows-timedrwlock.h"
834# if 1
835# define pthread_rwlock_t rpl_pthread_rwlock_t
836# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
837# endif
838# if !GNULIB_defined_pthread_rwlock_types
839typedef glwthread_timedrwlock_t pthread_rwlock_t;
840typedef unsigned int pthread_rwlockattr_t;
841# define GNULIB_defined_pthread_rwlock_types 1
842# endif
843# undef PTHREAD_RWLOCK_INITIALIZER
844# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT
845# else
846# if 1
847# define pthread_rwlock_t rpl_pthread_rwlock_t
848# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
849# endif
850# if !GNULIB_defined_pthread_rwlock_types
851typedef int pthread_rwlock_t;
852typedef unsigned int pthread_rwlockattr_t;
853# define GNULIB_defined_pthread_rwlock_types 1
854# endif
855# undef PTHREAD_RWLOCK_INITIALIZER
856# define PTHREAD_RWLOCK_INITIALIZER { 0 }
857# endif
858#elif 0 && 0 /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */
859# if 1
860# define pthread_rwlock_t rpl_pthread_rwlock_t
861# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
862# endif
863# if !GNULIB_defined_pthread_rwlock_types
864typedef struct
865 {
866 pthread_mutex_t lock; /* protects the remaining fields */
867 pthread_cond_t waiting_readers; /* waiting readers */
868 pthread_cond_t waiting_writers; /* waiting writers */
869 unsigned int waiting_writers_count; /* number of waiting writers */
870 int runcount; /* number of readers running, or -1 when a writer runs */
871 }
872 pthread_rwlock_t;
873typedef unsigned int pthread_rwlockattr_t;
874# define GNULIB_defined_pthread_rwlock_types 1
875# endif
876# undef PTHREAD_RWLOCK_INITIALIZER
877# define PTHREAD_RWLOCK_INITIALIZER \
878 { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
879#elif 0 && 0 /* i.e. PTHREAD_RWLOCK_BAD_WAITQUEUE */
880/* Use rwlocks of kind PREFER_WRITER or PREFER_WRITER_NONRECURSIVE instead of
881 the DEFAULT. */
882# undef PTHREAD_RWLOCK_INITIALIZER
883# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
884#else
885# if 1
886# if !defined PTHREAD_RWLOCK_INITIALIZER && defined PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */
887# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP
888# endif
889# else
890# if !GNULIB_defined_pthread_rwlock_types
891typedef int pthread_rwlock_t;
892typedef unsigned int pthread_rwlockattr_t;
893# define GNULIB_defined_pthread_rwlock_types 1
894# endif
895# undef PTHREAD_RWLOCK_INITIALIZER
896# define PTHREAD_RWLOCK_INITIALIZER { 0 }
897# endif
898#endif
899
900/* =========== Condition variable types and macros =========== */
901
902#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
903# if 0
904# include "windows-cond.h"
905# if 1
906# define pthread_cond_t rpl_pthread_cond_t
907# define pthread_condattr_t rpl_pthread_condattr_t
908# endif
909# if !GNULIB_defined_pthread_cond_types
910typedef glwthread_cond_t pthread_cond_t;
911typedef unsigned int pthread_condattr_t;
912# define GNULIB_defined_pthread_cond_types 1
913# endif
914# undef PTHREAD_COND_INITIALIZER
915# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT
916# else
917# if 1
918# define pthread_cond_t rpl_pthread_cond_t
919# define pthread_condattr_t rpl_pthread_condattr_t
920# endif
921# if !GNULIB_defined_pthread_cond_types
922typedef int pthread_cond_t;
923typedef unsigned int pthread_condattr_t;
924# define GNULIB_defined_pthread_cond_types 1
925# endif
926# undef PTHREAD_COND_INITIALIZER
927# define PTHREAD_COND_INITIALIZER { 0 }
928# endif
929#else
930# if !1
931# if !GNULIB_defined_pthread_cond_types
932typedef int pthread_cond_t;
933typedef unsigned int pthread_condattr_t;
934# define GNULIB_defined_pthread_cond_types 1
935# endif
936# undef PTHREAD_COND_INITIALIZER
937# define PTHREAD_COND_INITIALIZER { 0 }
938# endif
939#endif
940
941/* =========== Thread-specific storage types and macros =========== */
942
943#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
944# if 0
945# include "windows-tls.h"
946# if 1
947# define pthread_key_t rpl_pthread_key_t
948# endif
949# if !GNULIB_defined_pthread_tss_types
950typedef glwthread_tls_key_t pthread_key_t;
951# define GNULIB_defined_pthread_tss_types 1
952# endif
953# undef PTHREAD_DESTRUCTOR_ITERATIONS
954# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS
955# else
956# if 1
957# define pthread_key_t rpl_pthread_key_t
958# endif
959# if !GNULIB_defined_pthread_tss_types
960typedef void ** pthread_key_t;
961# define GNULIB_defined_pthread_tss_types 1
962# endif
963# undef PTHREAD_DESTRUCTOR_ITERATIONS
964# define PTHREAD_DESTRUCTOR_ITERATIONS 0
965# endif
966#else
967# if !1
968# if !GNULIB_defined_pthread_tss_types
969typedef void ** pthread_key_t;
970# define GNULIB_defined_pthread_tss_types 1
971# endif
972# undef PTHREAD_DESTRUCTOR_ITERATIONS
973# define PTHREAD_DESTRUCTOR_ITERATIONS 0
974# endif
975#endif
976
977/* =========== Spinlock types and macros =========== */
978
979#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
980# if 0
981# include "windows-spin.h"
982# if 1
983# define pthread_spinlock_t rpl_pthread_spinlock_t
984# endif
985# if !GNULIB_defined_pthread_spin_types
986typedef glwthread_spinlock_t pthread_spinlock_t;
987# define GNULIB_defined_pthread_spin_types 1
988# endif
989# else
990# if 1
991# define pthread_spinlock_t rpl_pthread_spinlock_t
992# endif
993# if !GNULIB_defined_pthread_spin_types
994typedef pthread_mutex_t pthread_spinlock_t;
995# define GNULIB_defined_pthread_spin_types 1
996# endif
997# endif
998# undef PTHREAD_PROCESS_PRIVATE
999# undef PTHREAD_PROCESS_SHARED
1000# define PTHREAD_PROCESS_PRIVATE 0
1001# define PTHREAD_PROCESS_SHARED 1
1002#else
1003# if 1
1004/* <pthread.h> exists and defines pthread_spinlock_t. */
1005# if !1 || 0
1006/* If the 'pthread-spin' module is in use, it defines all the pthread_spin*
1007 functions. Prepare for it by overriding pthread_spinlock_t if that might
1008 be needed. */
1009# if !(((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \
1010 || __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) \
1011 || (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
1012 && !defined __ANDROID__) \
1013 || __clang_major__ >= 3)) \
1014 && !defined __ibmxl__)
1015/* We can't use GCC built-ins. Approximate spinlocks with mutexes. */
1016# if !GNULIB_defined_pthread_spin_types
1017# define pthread_spinlock_t pthread_mutex_t
1018# define GNULIB_defined_pthread_spin_types 1
1019# endif
1020# endif
1021# endif
1022# else
1023/* Approximate spinlocks with mutexes. */
1024# if !GNULIB_defined_pthread_spin_types
1025typedef pthread_mutex_t pthread_spinlock_t;
1026# define GNULIB_defined_pthread_spin_types 1
1027# endif
1028# endif
1029# if !1
1030# define PTHREAD_PROCESS_PRIVATE 0
1031# define PTHREAD_PROCESS_SHARED 1
1032# endif
1033#endif
1034
1035/* =========== Other types and macros =========== */
1036
1037#if !1
1038# if !GNULIB_defined_other_pthread_types
1039typedef int pthread_barrier_t;
1040typedef unsigned int pthread_barrierattr_t;
1041# define GNULIB_defined_other_pthread_types 1
1042# endif
1043#endif
1044
1045#if !defined PTHREAD_CANCELED
1046
1047# define PTHREAD_BARRIER_SERIAL_THREAD (-1)
1048
1049# define PTHREAD_CANCEL_DEFERRED 0
1050# define PTHREAD_CANCEL_ASYNCHRONOUS 1
1051
1052# define PTHREAD_CANCEL_ENABLE 0
1053# define PTHREAD_CANCEL_DISABLE 1
1054
1055# define PTHREAD_CANCELED ((void *) -1)
1056
1057# define PTHREAD_INHERIT_SCHED 0
1058# define PTHREAD_EXPLICIT_SCHED 1
1059
1060# define PTHREAD_PRIO_NONE 0
1061# define PTHREAD_PRIO_INHERIT 1
1062# define PTHREAD_PRIO_PROTECT 2
1063
1064# define PTHREAD_SCOPE_SYSTEM 0
1065# define PTHREAD_SCOPE_PROCESS 1
1066
1067#endif
1068
1069/* =========== Thread functions =========== */
1070
1071#if 0
1072/* The 'restrict' qualifier on ARG is nonsense, but POSIX specifies it this way.
1073 Sigh. */
1074# if 0
1075# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1076# undef pthread_create
1077# define pthread_create rpl_pthread_create
1078# endif
1079_GL_FUNCDECL_RPL (pthread_create, int,
1080 (pthread_t *restrict threadp,
1081 const pthread_attr_t *restrict attr,
1082 void * (*mainfunc) (void *), void *restrict arg),
1083 _GL_ARG_NONNULL ((1, 3)));
1084_GL_CXXALIAS_RPL (pthread_create, int,
1085 (pthread_t *restrict threadp,
1086 const pthread_attr_t *restrict attr,
1087 void * (*mainfunc) (void *), void *restrict arg));
1088# else
1089# if !1
1090_GL_FUNCDECL_SYS (pthread_create, int,
1091 (pthread_t *restrict threadp,
1092 const pthread_attr_t *restrict attr,
1093 void * (*mainfunc) (void *), void *restrict arg),
1094 _GL_ARG_NONNULL ((1, 3)));
1095# endif
1096_GL_CXXALIAS_SYS_CAST (pthread_create, int,
1097 (pthread_t *restrict threadp,
1098 const pthread_attr_t *restrict attr,
1099 void * (*mainfunc) (void *), void *restrict arg));
1100# endif
1101# if __GLIBC__ >= 2
1102_GL_CXXALIASWARN (pthread_create);
1103# endif
1104#elif defined GNULIB_POSIXCHECK
1105# undef pthread_create
1106# if HAVE_RAW_DECL_PTHREAD_CREATE
1107_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - "
1108 "use gnulib module pthread-thread for portability");
1109# endif
1110#endif
1111
1112#if 0
1113# if 0
1114# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1115# undef pthread_attr_init
1116# define pthread_attr_init rpl_pthread_attr_init
1117# endif
1118_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr),
1119 _GL_ARG_NONNULL ((1)));
1120_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr));
1121# else
1122# if !1
1123_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr),
1124 _GL_ARG_NONNULL ((1)));
1125# endif
1126_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr));
1127# endif
1128# if __GLIBC__ >= 2
1129_GL_CXXALIASWARN (pthread_attr_init);
1130# endif
1131#elif defined GNULIB_POSIXCHECK
1132# undef pthread_attr_init
1133# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT
1134_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - "
1135 "use gnulib module pthread-thread for portability");
1136# endif
1137#endif
1138
1139#if 0
1140# if 0
1141# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1142# undef pthread_attr_getdetachstate
1143# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate
1144# endif
1145_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int,
1146 (const pthread_attr_t *attr, int *detachstatep),
1147 _GL_ARG_NONNULL ((1, 2)));
1148_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int,
1149 (const pthread_attr_t *attr, int *detachstatep));
1150# else
1151# if !1
1152_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int,
1153 (const pthread_attr_t *attr, int *detachstatep),
1154 _GL_ARG_NONNULL ((1, 2)));
1155# endif
1156_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int,
1157 (const pthread_attr_t *attr, int *detachstatep));
1158# endif
1159# if __GLIBC__ >= 2
1160_GL_CXXALIASWARN (pthread_attr_getdetachstate);
1161# endif
1162#elif defined GNULIB_POSIXCHECK
1163# undef pthread_attr_getdetachstate
1164# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE
1165_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - "
1166 "use gnulib module pthread-thread for portability");
1167# endif
1168#endif
1169
1170#if 0
1171# if 0
1172# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1173# undef pthread_attr_setdetachstate
1174# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate
1175# endif
1176_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int,
1177 (pthread_attr_t *attr, int detachstate),
1178 _GL_ARG_NONNULL ((1)));
1179_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int,
1180 (pthread_attr_t *attr, int detachstate));
1181# else
1182# if !1
1183_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int,
1184 (pthread_attr_t *attr, int detachstate),
1185 _GL_ARG_NONNULL ((1)));
1186# endif
1187_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int,
1188 (pthread_attr_t *attr, int detachstate));
1189# endif
1190# if __GLIBC__ >= 2
1191_GL_CXXALIASWARN (pthread_attr_setdetachstate);
1192# endif
1193#elif defined GNULIB_POSIXCHECK
1194# undef pthread_attr_setdetachstate
1195# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE
1196_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - "
1197 "use gnulib module pthread-thread for portability");
1198# endif
1199#endif
1200
1201#if 0
1202# if 0
1203# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1204# undef pthread_attr_destroy
1205# define pthread_attr_destroy rpl_pthread_attr_destroy
1206# endif
1207_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr),
1208 _GL_ARG_NONNULL ((1)));
1209_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr));
1210# else
1211# if !1
1212_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr),
1213 _GL_ARG_NONNULL ((1)));
1214# endif
1215_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr));
1216# endif
1217# if __GLIBC__ >= 2
1218_GL_CXXALIASWARN (pthread_attr_destroy);
1219# endif
1220#elif defined GNULIB_POSIXCHECK
1221# undef pthread_attr_destroy
1222# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY
1223_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - "
1224 "use gnulib module pthread-thread for portability");
1225# endif
1226#endif
1227
1228#if 0
1229# if 0
1230# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1231# undef pthread_self
1232# define pthread_self rpl_pthread_self
1233# endif
1234_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE);
1235_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void));
1236# else
1237# if !1
1238_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE);
1239# endif
1240_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void));
1241# endif
1242# if __GLIBC__ >= 2
1243_GL_CXXALIASWARN (pthread_self);
1244# endif
1245#elif defined GNULIB_POSIXCHECK
1246# undef pthread_self
1247# if HAVE_RAW_DECL_PTHREAD_SELF
1248_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - "
1249 "use gnulib module pthread-thread for portability");
1250# endif
1251#endif
1252
1253#if 0
1254# if 0
1255# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1256# undef pthread_equal
1257# define pthread_equal rpl_pthread_equal
1258# endif
1259_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2), );
1260_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
1261# else
1262# if !1
1263_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2), );
1264# endif
1265_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
1266# endif
1267# if __GLIBC__ >= 2
1268_GL_CXXALIASWARN (pthread_equal);
1269# endif
1270#elif defined GNULIB_POSIXCHECK
1271# undef pthread_equal
1272# if HAVE_RAW_DECL_PTHREAD_EQUAL
1273_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - "
1274 "use gnulib module pthread-thread for portability");
1275# endif
1276#endif
1277
1278#if 0
1279# if 0
1280# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1281# undef pthread_detach
1282# define pthread_detach rpl_pthread_detach
1283# endif
1284_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread), );
1285_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread));
1286# else
1287# if !1
1288_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread), );
1289# endif
1290_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread));
1291# endif
1292# if __GLIBC__ >= 2
1293_GL_CXXALIASWARN (pthread_detach);
1294# endif
1295#elif defined GNULIB_POSIXCHECK
1296# undef pthread_detach
1297# if HAVE_RAW_DECL_PTHREAD_DETACH
1298_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - "
1299 "use gnulib module pthread-thread for portability");
1300# endif
1301#endif
1302
1303#if 0
1304# if 0
1305# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1306# undef pthread_join
1307# define pthread_join rpl_pthread_join
1308# endif
1309_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep), );
1310_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep));
1311# else
1312# if !1
1313_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep), );
1314# endif
1315_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep));
1316# endif
1317# if __GLIBC__ >= 2
1318_GL_CXXALIASWARN (pthread_join);
1319# endif
1320#elif defined GNULIB_POSIXCHECK
1321# undef pthread_join
1322# if HAVE_RAW_DECL_PTHREAD_JOIN
1323_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - "
1324 "use gnulib module pthread-thread for portability");
1325# endif
1326#endif
1327
1328#if 0
1329# if 0
1330# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1331# undef pthread_exit
1332# define pthread_exit rpl_pthread_exit
1333# endif
1334_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value), );
1335_GL_CXXALIAS_RPL (pthread_exit, void, (void *value));
1336# else
1337# if !1
1338_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value), );
1339# endif
1340/* Need to cast because of AIX with xlclang++. */
1341_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value));
1342# endif
1343# if __GLIBC__ >= 2
1344_GL_CXXALIASWARN (pthread_exit);
1345# endif
1346#elif defined GNULIB_POSIXCHECK
1347# undef pthread_exit
1348# if HAVE_RAW_DECL_PTHREAD_EXIT
1349_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - "
1350 "use gnulib module pthread-thread for portability");
1351# endif
1352#endif
1353
1354/* =========== Once-only control (initialization) functions =========== */
1355
1356#if 1
1357# if 0
1358# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1359# undef pthread_once
1360# define pthread_once rpl_pthread_once
1361# endif
1362_GL_FUNCDECL_RPL (pthread_once, int,
1363 (pthread_once_t *once_control, void (*initfunction) (void)),
1364 _GL_ARG_NONNULL ((1, 2)));
1365_GL_CXXALIAS_RPL (pthread_once, int,
1366 (pthread_once_t *once_control, void (*initfunction) (void)));
1367# else
1368# if !1
1369_GL_FUNCDECL_SYS (pthread_once, int,
1370 (pthread_once_t *once_control, void (*initfunction) (void)),
1371 _GL_ARG_NONNULL ((1, 2)));
1372# endif
1373_GL_CXXALIAS_SYS_CAST (pthread_once, int,
1374 (pthread_once_t *once_control,
1375 void (*initfunction) (void)));
1376# endif
1377# if __GLIBC__ >= 2
1378_GL_CXXALIASWARN (pthread_once);
1379# endif
1380#elif defined GNULIB_POSIXCHECK
1381# undef pthread_once
1382# if HAVE_RAW_DECL_PTHREAD_ONCE
1383_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - "
1384 "use gnulib module pthread-once for portability");
1385# endif
1386#endif
1387
1388/* =========== Mutex functions =========== */
1389
1390#if 0
1391# if 0
1392# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1393# undef pthread_mutex_init
1394# define pthread_mutex_init rpl_pthread_mutex_init
1395# endif
1396_GL_FUNCDECL_RPL (pthread_mutex_init, int,
1397 (pthread_mutex_t *restrict mutex,
1398 const pthread_mutexattr_t *restrict attr),
1399 _GL_ARG_NONNULL ((1)));
1400_GL_CXXALIAS_RPL (pthread_mutex_init, int,
1401 (pthread_mutex_t *restrict mutex,
1402 const pthread_mutexattr_t *restrict attr));
1403# else
1404# if !1
1405_GL_FUNCDECL_SYS (pthread_mutex_init, int,
1406 (pthread_mutex_t *restrict mutex,
1407 const pthread_mutexattr_t *restrict attr),
1408 _GL_ARG_NONNULL ((1)));
1409# endif
1410_GL_CXXALIAS_SYS (pthread_mutex_init, int,
1411 (pthread_mutex_t *restrict mutex,
1412 const pthread_mutexattr_t *restrict attr));
1413# endif
1414# if __GLIBC__ >= 2
1415_GL_CXXALIASWARN (pthread_mutex_init);
1416# endif
1417#elif defined GNULIB_POSIXCHECK
1418# undef pthread_mutex_init
1419# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT
1420_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - "
1421 "use gnulib module pthread-mutex for portability");
1422# endif
1423#endif
1424
1425#if 0
1426# if 0
1427# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1428# undef pthread_mutexattr_init
1429# define pthread_mutexattr_init rpl_pthread_mutexattr_init
1430# endif
1431_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr),
1432 _GL_ARG_NONNULL ((1)));
1433_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
1434# else
1435# if !1
1436_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr),
1437 _GL_ARG_NONNULL ((1)));
1438# endif
1439_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
1440# endif
1441# if __GLIBC__ >= 2
1442_GL_CXXALIASWARN (pthread_mutexattr_init);
1443# endif
1444#elif defined GNULIB_POSIXCHECK
1445# undef pthread_mutexattr_init
1446# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT
1447_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - "
1448 "use gnulib module pthread-mutex for portability");
1449# endif
1450#endif
1451
1452#if 0
1453# if 0
1454# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1455# undef pthread_mutexattr_gettype
1456# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype
1457# endif
1458_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int,
1459 (const pthread_mutexattr_t *restrict attr,
1460 int *restrict typep),
1461 _GL_ARG_NONNULL ((1, 2)));
1462_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int,
1463 (const pthread_mutexattr_t *restrict attr,
1464 int *restrict typep));
1465# else
1466# if !1
1467_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int,
1468 (const pthread_mutexattr_t *restrict attr,
1469 int *restrict typep),
1470 _GL_ARG_NONNULL ((1, 2)));
1471# endif
1472/* Need to cast, because on FreeBSD the first parameter is
1473 pthread_mutexattr_t *attr. */
1474_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int,
1475 (const pthread_mutexattr_t *restrict attr,
1476 int *restrict typep));
1477# endif
1478# if __GLIBC__ >= 2
1479_GL_CXXALIASWARN (pthread_mutexattr_gettype);
1480# endif
1481#elif defined GNULIB_POSIXCHECK
1482# undef pthread_mutexattr_gettype
1483# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE
1484_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - "
1485 "use gnulib module pthread-mutex for portability");
1486# endif
1487#endif
1488
1489#if 0
1490# if 0
1491# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1492# undef pthread_mutexattr_settype
1493# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype
1494# endif
1495_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int,
1496 (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1)));
1497_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int,
1498 (pthread_mutexattr_t *attr, int type));
1499# else
1500# if !1
1501_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int,
1502 (pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1)));
1503# endif
1504_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int,
1505 (pthread_mutexattr_t *attr, int type));
1506# endif
1507# if __GLIBC__ >= 2
1508_GL_CXXALIASWARN (pthread_mutexattr_settype);
1509# endif
1510#elif defined GNULIB_POSIXCHECK
1511# undef pthread_mutexattr_settype
1512# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE
1513_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - "
1514 "use gnulib module pthread-mutex for portability");
1515# endif
1516#endif
1517
1518#if 0
1519# if 0
1520# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1521# undef pthread_mutexattr_getrobust
1522# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust
1523# endif
1524_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int,
1525 (const pthread_mutexattr_t *restrict attr,
1526 int *restrict robustp),
1527 _GL_ARG_NONNULL ((1, 2)));
1528_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int,
1529 (const pthread_mutexattr_t *restrict attr,
1530 int *restrict robustp));
1531# else
1532# if !1
1533_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int,
1534 (const pthread_mutexattr_t *restrict attr,
1535 int *restrict robustp),
1536 _GL_ARG_NONNULL ((1, 2)));
1537# endif
1538/* Need to cast, because on FreeBSD the first parameter is
1539 pthread_mutexattr_t *attr. */
1540_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int,
1541 (const pthread_mutexattr_t *restrict attr,
1542 int *restrict robustp));
1543# endif
1544# if __GLIBC__ >= 2
1545_GL_CXXALIASWARN (pthread_mutexattr_getrobust);
1546# endif
1547#elif defined GNULIB_POSIXCHECK
1548# undef pthread_mutexattr_getrobust
1549# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST
1550_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - "
1551 "use gnulib module pthread-mutex for portability");
1552# endif
1553#endif
1554
1555#if 0
1556# if 0
1557# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1558# undef pthread_mutexattr_setrobust
1559# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust
1560# endif
1561_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int,
1562 (pthread_mutexattr_t *attr, int robust),
1563 _GL_ARG_NONNULL ((1)));
1564_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int,
1565 (pthread_mutexattr_t *attr, int robust));
1566# else
1567# if !1
1568_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int,
1569 (pthread_mutexattr_t *attr, int robust),
1570 _GL_ARG_NONNULL ((1)));
1571# endif
1572_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int,
1573 (pthread_mutexattr_t *attr, int robust));
1574# endif
1575# if __GLIBC__ >= 2
1576_GL_CXXALIASWARN (pthread_mutexattr_setrobust);
1577# endif
1578#elif defined GNULIB_POSIXCHECK
1579# undef pthread_mutexattr_setrobust
1580# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST
1581_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - "
1582 "use gnulib module pthread-mutex for portability");
1583# endif
1584#endif
1585
1586#if 0
1587# if 0
1588# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1589# undef pthread_mutexattr_destroy
1590# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy
1591# endif
1592_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr),
1593 _GL_ARG_NONNULL ((1)));
1594_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
1595# else
1596# if !1
1597_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr),
1598 _GL_ARG_NONNULL ((1)));
1599# endif
1600_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
1601# endif
1602# if __GLIBC__ >= 2
1603_GL_CXXALIASWARN (pthread_mutexattr_destroy);
1604# endif
1605#elif defined GNULIB_POSIXCHECK
1606# undef pthread_mutexattr_destroy
1607# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY
1608_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - "
1609 "use gnulib module pthread-mutex for portability");
1610# endif
1611#endif
1612
1613#if 0
1614# if 0
1615# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1616# undef pthread_mutex_lock
1617# define pthread_mutex_lock rpl_pthread_mutex_lock
1618# endif
1619_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex),
1620 _GL_ARG_NONNULL ((1)));
1621_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
1622# else
1623# if !1
1624_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex),
1625 _GL_ARG_NONNULL ((1)));
1626# endif
1627_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
1628# endif
1629# if __GLIBC__ >= 2
1630_GL_CXXALIASWARN (pthread_mutex_lock);
1631# endif
1632#elif defined GNULIB_POSIXCHECK
1633# undef pthread_mutex_lock
1634# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK
1635_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - "
1636 "use gnulib module pthread-mutex for portability");
1637# endif
1638#endif
1639
1640#if 0
1641# if 0
1642# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1643# undef pthread_mutex_trylock
1644# define pthread_mutex_trylock rpl_pthread_mutex_trylock
1645# endif
1646_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex),
1647 _GL_ARG_NONNULL ((1)));
1648_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
1649# else
1650# if !1
1651_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex),
1652 _GL_ARG_NONNULL ((1)));
1653# endif
1654_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
1655# endif
1656# if __GLIBC__ >= 2
1657_GL_CXXALIASWARN (pthread_mutex_trylock);
1658# endif
1659#elif defined GNULIB_POSIXCHECK
1660# undef pthread_mutex_trylock
1661# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK
1662_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - "
1663 "use gnulib module pthread-mutex for portability");
1664# endif
1665#endif
1666
1667#if 0
1668# if 0
1669# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1670# undef pthread_mutex_timedlock
1671# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock
1672# endif
1673_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int,
1674 (pthread_mutex_t *restrict mutex,
1675 const struct timespec *restrict abstime),
1676 _GL_ARG_NONNULL ((1, 2)));
1677_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int,
1678 (pthread_mutex_t *restrict mutex,
1679 const struct timespec *restrict abstime));
1680# else
1681# if !1
1682_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int,
1683 (pthread_mutex_t *restrict mutex,
1684 const struct timespec *restrict abstime),
1685 _GL_ARG_NONNULL ((1, 2)));
1686# endif
1687_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int,
1688 (pthread_mutex_t *restrict mutex,
1689 const struct timespec *restrict abstime));
1690# endif
1691# if __GLIBC__ >= 2
1692_GL_CXXALIASWARN (pthread_mutex_timedlock);
1693# endif
1694#elif defined GNULIB_POSIXCHECK
1695# undef pthread_mutex_timedlock
1696# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK
1697_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - "
1698 "use gnulib module pthread_mutex_timedlock for portability");
1699# endif
1700#endif
1701
1702#if 0
1703# if 0
1704# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1705# undef pthread_mutex_unlock
1706# define pthread_mutex_unlock rpl_pthread_mutex_unlock
1707# endif
1708_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex),
1709 _GL_ARG_NONNULL ((1)));
1710_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
1711# else
1712# if !1
1713_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex),
1714 _GL_ARG_NONNULL ((1)));
1715# endif
1716_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
1717# endif
1718# if __GLIBC__ >= 2
1719_GL_CXXALIASWARN (pthread_mutex_unlock);
1720# endif
1721#elif defined GNULIB_POSIXCHECK
1722# undef pthread_mutex_unlock
1723# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK
1724_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - "
1725 "use gnulib module pthread-mutex for portability");
1726# endif
1727#endif
1728
1729#if 0
1730# if 0
1731# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1732# undef pthread_mutex_destroy
1733# define pthread_mutex_destroy rpl_pthread_mutex_destroy
1734# endif
1735_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex),
1736 _GL_ARG_NONNULL ((1)));
1737_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
1738# else
1739# if !1
1740_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex),
1741 _GL_ARG_NONNULL ((1)));
1742# endif
1743_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
1744# endif
1745# if __GLIBC__ >= 2
1746_GL_CXXALIASWARN (pthread_mutex_destroy);
1747# endif
1748#elif defined GNULIB_POSIXCHECK
1749# undef pthread_mutex_destroy
1750# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY
1751_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - "
1752 "use gnulib module pthread-mutex for portability");
1753# endif
1754#endif
1755
1756/* =========== Read-write lock functions =========== */
1757
1758#if 0
1759# if 0
1760# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1761# undef pthread_rwlock_init
1762# define pthread_rwlock_init rpl_pthread_rwlock_init
1763# endif
1764_GL_FUNCDECL_RPL (pthread_rwlock_init, int,
1765 (pthread_rwlock_t *restrict lock,
1766 const pthread_rwlockattr_t *restrict attr),
1767 _GL_ARG_NONNULL ((1)));
1768_GL_CXXALIAS_RPL (pthread_rwlock_init, int,
1769 (pthread_rwlock_t *restrict lock,
1770 const pthread_rwlockattr_t *restrict attr));
1771# else
1772# if !1
1773_GL_FUNCDECL_SYS (pthread_rwlock_init, int,
1774 (pthread_rwlock_t *restrict lock,
1775 const pthread_rwlockattr_t *restrict attr),
1776 _GL_ARG_NONNULL ((1)));
1777# endif
1778_GL_CXXALIAS_SYS (pthread_rwlock_init, int,
1779 (pthread_rwlock_t *restrict lock,
1780 const pthread_rwlockattr_t *restrict attr));
1781# endif
1782# if __GLIBC__ >= 2
1783_GL_CXXALIASWARN (pthread_rwlock_init);
1784# endif
1785#elif defined GNULIB_POSIXCHECK
1786# undef pthread_rwlock_init
1787# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT
1788_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - "
1789 "use gnulib module pthread-rwlock for portability");
1790# endif
1791#endif
1792
1793#if 0
1794# if 0
1795# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1796# undef pthread_rwlockattr_init
1797# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init
1798# endif
1799_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr),
1800 _GL_ARG_NONNULL ((1)));
1801_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
1802# else
1803# if !1
1804_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr),
1805 _GL_ARG_NONNULL ((1)));
1806# endif
1807_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
1808# endif
1809# if __GLIBC__ >= 2
1810_GL_CXXALIASWARN (pthread_rwlockattr_init);
1811# endif
1812#elif defined GNULIB_POSIXCHECK
1813# undef pthread_rwlockattr_init
1814# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT
1815_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - "
1816 "use gnulib module pthread-rwlock for portability");
1817# endif
1818#endif
1819
1820#if 0
1821# if 0
1822# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1823# undef pthread_rwlockattr_destroy
1824# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy
1825# endif
1826_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int,
1827 (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1)));
1828_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int,
1829 (pthread_rwlockattr_t *attr));
1830# else
1831# if !1
1832_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int,
1833 (pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1)));
1834# endif
1835_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int,
1836 (pthread_rwlockattr_t *attr));
1837# endif
1838# if __GLIBC__ >= 2
1839_GL_CXXALIASWARN (pthread_rwlockattr_destroy);
1840# endif
1841#elif defined GNULIB_POSIXCHECK
1842# undef pthread_rwlockattr_destroy
1843# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY
1844_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - "
1845 "use gnulib module pthread-rwlock for portability");
1846# endif
1847#endif
1848
1849#if 0
1850# if 0
1851# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1852# undef pthread_rwlock_rdlock
1853# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock
1854# endif
1855_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock),
1856 _GL_ARG_NONNULL ((1)));
1857_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
1858# else
1859# if !1
1860_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock),
1861 _GL_ARG_NONNULL ((1)));
1862# endif
1863_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
1864# endif
1865# if __GLIBC__ >= 2
1866_GL_CXXALIASWARN (pthread_rwlock_rdlock);
1867# endif
1868#elif defined GNULIB_POSIXCHECK
1869# undef pthread_rwlock_rdlock
1870# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK
1871_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - "
1872 "use gnulib module pthread-rwlock for portability");
1873# endif
1874#endif
1875
1876#if 0
1877# if 0
1878# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1879# undef pthread_rwlock_wrlock
1880# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock
1881# endif
1882_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock),
1883 _GL_ARG_NONNULL ((1)));
1884_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
1885# else
1886# if !1
1887_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock),
1888 _GL_ARG_NONNULL ((1)));
1889# endif
1890_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
1891# endif
1892# if __GLIBC__ >= 2
1893_GL_CXXALIASWARN (pthread_rwlock_wrlock);
1894# endif
1895#elif defined GNULIB_POSIXCHECK
1896# undef pthread_rwlock_wrlock
1897# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK
1898_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - "
1899 "use gnulib module pthread-rwlock for portability");
1900# endif
1901#endif
1902
1903#if 0
1904# if 0
1905# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1906# undef pthread_rwlock_tryrdlock
1907# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock
1908# endif
1909_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock),
1910 _GL_ARG_NONNULL ((1)));
1911_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
1912# else
1913# if !1
1914_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock),
1915 _GL_ARG_NONNULL ((1)));
1916# endif
1917_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
1918# endif
1919# if __GLIBC__ >= 2
1920_GL_CXXALIASWARN (pthread_rwlock_tryrdlock);
1921# endif
1922#elif defined GNULIB_POSIXCHECK
1923# undef pthread_rwlock_tryrdlock
1924# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK
1925_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - "
1926 "use gnulib module pthread-rwlock for portability");
1927# endif
1928#endif
1929
1930#if 0
1931# if 0
1932# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1933# undef pthread_rwlock_trywrlock
1934# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock
1935# endif
1936_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock),
1937 _GL_ARG_NONNULL ((1)));
1938_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
1939# else
1940# if !1
1941_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock),
1942 _GL_ARG_NONNULL ((1)));
1943# endif
1944_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
1945# endif
1946# if __GLIBC__ >= 2
1947_GL_CXXALIASWARN (pthread_rwlock_trywrlock);
1948# endif
1949#elif defined GNULIB_POSIXCHECK
1950# undef pthread_rwlock_trywrlock
1951# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK
1952_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - "
1953 "use gnulib module pthread-rwlock for portability");
1954# endif
1955#endif
1956
1957#if 0
1958# if 0
1959# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1960# undef pthread_rwlock_timedrdlock
1961# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock
1962# endif
1963_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int,
1964 (pthread_rwlock_t *restrict lock,
1965 const struct timespec *restrict abstime),
1966 _GL_ARG_NONNULL ((1, 2)));
1967_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int,
1968 (pthread_rwlock_t *restrict lock,
1969 const struct timespec *restrict abstime));
1970# else
1971# if !1
1972_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int,
1973 (pthread_rwlock_t *restrict lock,
1974 const struct timespec *restrict abstime),
1975 _GL_ARG_NONNULL ((1, 2)));
1976# endif
1977_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int,
1978 (pthread_rwlock_t *restrict lock,
1979 const struct timespec *restrict abstime));
1980# endif
1981# if __GLIBC__ >= 2
1982_GL_CXXALIASWARN (pthread_rwlock_timedrdlock);
1983# endif
1984#elif defined GNULIB_POSIXCHECK
1985# undef pthread_rwlock_timedrdlock
1986# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK
1987_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - "
1988 "use gnulib module pthread-rwlock for portability");
1989# endif
1990#endif
1991
1992#if 0
1993# if 0
1994# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1995# undef pthread_rwlock_timedwrlock
1996# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock
1997# endif
1998_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int,
1999 (pthread_rwlock_t *restrict lock,
2000 const struct timespec *restrict abstime),
2001 _GL_ARG_NONNULL ((1, 2)));
2002_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int,
2003 (pthread_rwlock_t *restrict lock,
2004 const struct timespec *restrict abstime));
2005# else
2006# if !1
2007_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int,
2008 (pthread_rwlock_t *restrict lock,
2009 const struct timespec *restrict abstime),
2010 _GL_ARG_NONNULL ((1, 2)));
2011# endif
2012_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int,
2013 (pthread_rwlock_t *restrict lock,
2014 const struct timespec *restrict abstime));
2015# endif
2016# if __GLIBC__ >= 2
2017_GL_CXXALIASWARN (pthread_rwlock_timedwrlock);
2018# endif
2019#elif defined GNULIB_POSIXCHECK
2020# undef pthread_rwlock_timedwrlock
2021# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK
2022_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - "
2023 "use gnulib module pthread-rwlock for portability");
2024# endif
2025#endif
2026
2027#if 0
2028# if 0
2029# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2030# undef pthread_rwlock_unlock
2031# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock
2032# endif
2033_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock),
2034 _GL_ARG_NONNULL ((1)));
2035_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
2036# else
2037# if !1
2038_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock),
2039 _GL_ARG_NONNULL ((1)));
2040# endif
2041_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
2042# endif
2043# if __GLIBC__ >= 2
2044_GL_CXXALIASWARN (pthread_rwlock_unlock);
2045# endif
2046#elif defined GNULIB_POSIXCHECK
2047# undef pthread_rwlock_unlock
2048# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK
2049_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - "
2050 "use gnulib module pthread-rwlock for portability");
2051# endif
2052#endif
2053
2054#if 0
2055# if 0
2056# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2057# undef pthread_rwlock_destroy
2058# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy
2059# endif
2060_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock),
2061 _GL_ARG_NONNULL ((1)));
2062_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
2063# else
2064# if !1
2065_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock),
2066 _GL_ARG_NONNULL ((1)));
2067# endif
2068_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
2069# endif
2070# if __GLIBC__ >= 2
2071_GL_CXXALIASWARN (pthread_rwlock_destroy);
2072# endif
2073#elif defined GNULIB_POSIXCHECK
2074# undef pthread_rwlock_destroy
2075# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY
2076_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - "
2077 "use gnulib module pthread-rwlock for portability");
2078# endif
2079#endif
2080
2081/* =========== Condition variable functions =========== */
2082
2083#if 0
2084# if 0
2085# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2086# undef pthread_cond_init
2087# define pthread_cond_init rpl_pthread_cond_init
2088# endif
2089_GL_FUNCDECL_RPL (pthread_cond_init, int,
2090 (pthread_cond_t *restrict cond,
2091 const pthread_condattr_t *restrict attr),
2092 _GL_ARG_NONNULL ((1)));
2093_GL_CXXALIAS_RPL (pthread_cond_init, int,
2094 (pthread_cond_t *restrict cond,
2095 const pthread_condattr_t *restrict attr));
2096# else
2097# if !1
2098_GL_FUNCDECL_SYS (pthread_cond_init, int,
2099 (pthread_cond_t *restrict cond,
2100 const pthread_condattr_t *restrict attr),
2101 _GL_ARG_NONNULL ((1)));
2102# endif
2103_GL_CXXALIAS_SYS (pthread_cond_init, int,
2104 (pthread_cond_t *restrict cond,
2105 const pthread_condattr_t *restrict attr));
2106# endif
2107# if __GLIBC__ >= 2
2108_GL_CXXALIASWARN (pthread_cond_init);
2109# endif
2110#elif defined GNULIB_POSIXCHECK
2111# undef pthread_cond_init
2112# if HAVE_RAW_DECL_PTHREAD_COND_INIT
2113_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - "
2114 "use gnulib module pthread-cond for portability");
2115# endif
2116#endif
2117
2118#if 0
2119# if 0
2120# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2121# undef pthread_condattr_init
2122# define pthread_condattr_init rpl_pthread_condattr_init
2123# endif
2124_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr),
2125 _GL_ARG_NONNULL ((1)));
2126_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr));
2127# else
2128# if !1
2129_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr),
2130 _GL_ARG_NONNULL ((1)));
2131# endif
2132_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr));
2133# endif
2134# if __GLIBC__ >= 2
2135_GL_CXXALIASWARN (pthread_condattr_init);
2136# endif
2137#elif defined GNULIB_POSIXCHECK
2138# undef pthread_condattr_init
2139# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT
2140_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - "
2141 "use gnulib module pthread-cond for portability");
2142# endif
2143#endif
2144
2145#if 0
2146# if 0
2147# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2148# undef pthread_condattr_destroy
2149# define pthread_condattr_destroy rpl_pthread_condattr_destroy
2150# endif
2151_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr),
2152 _GL_ARG_NONNULL ((1)));
2153_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
2154# else
2155# if !1
2156_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr),
2157 _GL_ARG_NONNULL ((1)));
2158# endif
2159_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
2160# endif
2161# if __GLIBC__ >= 2
2162_GL_CXXALIASWARN (pthread_condattr_destroy);
2163# endif
2164#elif defined GNULIB_POSIXCHECK
2165# undef pthread_condattr_destroy
2166# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY
2167_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - "
2168 "use gnulib module pthread-cond for portability");
2169# endif
2170#endif
2171
2172#if 0
2173# if 0
2174# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2175# undef pthread_cond_wait
2176# define pthread_cond_wait rpl_pthread_cond_wait
2177# endif
2178_GL_FUNCDECL_RPL (pthread_cond_wait, int,
2179 (pthread_cond_t *restrict cond,
2180 pthread_mutex_t *restrict mutex),
2181 _GL_ARG_NONNULL ((1, 2)));
2182_GL_CXXALIAS_RPL (pthread_cond_wait, int,
2183 (pthread_cond_t *restrict cond,
2184 pthread_mutex_t *restrict mutex));
2185# else
2186# if !1
2187_GL_FUNCDECL_SYS (pthread_cond_wait, int,
2188 (pthread_cond_t *restrict cond,
2189 pthread_mutex_t *restrict mutex),
2190 _GL_ARG_NONNULL ((1, 2)));
2191# endif
2192_GL_CXXALIAS_SYS (pthread_cond_wait, int,
2193 (pthread_cond_t *restrict cond,
2194 pthread_mutex_t *restrict mutex));
2195# endif
2196# if __GLIBC__ >= 2
2197_GL_CXXALIASWARN (pthread_cond_wait);
2198# endif
2199#elif defined GNULIB_POSIXCHECK
2200# undef pthread_cond_wait
2201# if HAVE_RAW_DECL_PTHREAD_COND_WAIT
2202_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - "
2203 "use gnulib module pthread-cond for portability");
2204# endif
2205#endif
2206
2207#if 0
2208# if 0
2209# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2210# undef pthread_cond_timedwait
2211# define pthread_cond_timedwait rpl_pthread_cond_timedwait
2212# endif
2213_GL_FUNCDECL_RPL (pthread_cond_timedwait, int,
2214 (pthread_cond_t *restrict cond,
2215 pthread_mutex_t *restrict mutex,
2216 const struct timespec *restrict abstime),
2217 _GL_ARG_NONNULL ((1, 2, 3)));
2218_GL_CXXALIAS_RPL (pthread_cond_timedwait, int,
2219 (pthread_cond_t *restrict cond,
2220 pthread_mutex_t *restrict mutex,
2221 const struct timespec *restrict abstime));
2222# else
2223# if !1
2224_GL_FUNCDECL_SYS (pthread_cond_timedwait, int,
2225 (pthread_cond_t *restrict cond,
2226 pthread_mutex_t *restrict mutex,
2227 const struct timespec *restrict abstime),
2228 _GL_ARG_NONNULL ((1, 2, 3)));
2229# endif
2230_GL_CXXALIAS_SYS (pthread_cond_timedwait, int,
2231 (pthread_cond_t *restrict cond,
2232 pthread_mutex_t *restrict mutex,
2233 const struct timespec *restrict abstime));
2234# endif
2235# if __GLIBC__ >= 2
2236_GL_CXXALIASWARN (pthread_cond_timedwait);
2237# endif
2238#elif defined GNULIB_POSIXCHECK
2239# undef pthread_cond_timedwait
2240# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT
2241_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - "
2242 "use gnulib module pthread-cond for portability");
2243# endif
2244#endif
2245
2246#if 0
2247# if 0
2248# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2249# undef pthread_cond_signal
2250# define pthread_cond_signal rpl_pthread_cond_signal
2251# endif
2252_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond),
2253 _GL_ARG_NONNULL ((1)));
2254_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond));
2255# else
2256# if !1
2257_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond),
2258 _GL_ARG_NONNULL ((1)));
2259# endif
2260_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond));
2261# endif
2262# if __GLIBC__ >= 2
2263_GL_CXXALIASWARN (pthread_cond_signal);
2264# endif
2265#elif defined GNULIB_POSIXCHECK
2266# undef pthread_cond_signal
2267# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL
2268_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - "
2269 "use gnulib module pthread-cond for portability");
2270# endif
2271#endif
2272
2273#if 0
2274# if 0
2275# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2276# undef pthread_cond_broadcast
2277# define pthread_cond_broadcast rpl_pthread_cond_broadcast
2278# endif
2279_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond),
2280 _GL_ARG_NONNULL ((1)));
2281_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond));
2282# else
2283# if !1
2284_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond),
2285 _GL_ARG_NONNULL ((1)));
2286# endif
2287_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond));
2288# endif
2289# if __GLIBC__ >= 2
2290_GL_CXXALIASWARN (pthread_cond_broadcast);
2291# endif
2292#elif defined GNULIB_POSIXCHECK
2293# undef pthread_cond_broadcast
2294# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST
2295_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - "
2296 "use gnulib module pthread-cond for portability");
2297# endif
2298#endif
2299
2300#if 0
2301# if 0
2302# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2303# undef pthread_cond_destroy
2304# define pthread_cond_destroy rpl_pthread_cond_destroy
2305# endif
2306_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond),
2307 _GL_ARG_NONNULL ((1)));
2308_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond));
2309# else
2310# if !1
2311_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond),
2312 _GL_ARG_NONNULL ((1)));
2313# endif
2314_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond));
2315# endif
2316# if __GLIBC__ >= 2
2317_GL_CXXALIASWARN (pthread_cond_destroy);
2318# endif
2319#elif defined GNULIB_POSIXCHECK
2320# undef pthread_cond_destroy
2321# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY
2322_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - "
2323 "use gnulib module pthread-cond for portability");
2324# endif
2325#endif
2326
2327/* =========== Thread-specific storage functions =========== */
2328
2329#if 0
2330# if 0
2331# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2332# undef pthread_key_create
2333# define pthread_key_create rpl_pthread_key_create
2334# endif
2335_GL_FUNCDECL_RPL (pthread_key_create, int,
2336 (pthread_key_t *keyp, void (*destructor) (void *)),
2337 _GL_ARG_NONNULL ((1)));
2338_GL_CXXALIAS_RPL (pthread_key_create, int,
2339 (pthread_key_t *keyp, void (*destructor) (void *)));
2340# else
2341# if !1
2342_GL_FUNCDECL_SYS (pthread_key_create, int,
2343 (pthread_key_t *keyp, void (*destructor) (void *)),
2344 _GL_ARG_NONNULL ((1)));
2345# endif
2346_GL_CXXALIAS_SYS_CAST (pthread_key_create, int,
2347 (pthread_key_t *keyp, void (*destructor) (void *)));
2348# endif
2349# if __GLIBC__ >= 2
2350_GL_CXXALIASWARN (pthread_key_create);
2351# endif
2352#elif defined GNULIB_POSIXCHECK
2353# undef pthread_key_create
2354# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE
2355_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - "
2356 "use gnulib module pthread-tss for portability");
2357# endif
2358#endif
2359
2360#if 0
2361# if 0
2362# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2363# undef pthread_setspecific
2364# define pthread_setspecific rpl_pthread_setspecific
2365# endif
2366_GL_FUNCDECL_RPL (pthread_setspecific, int,
2367 (pthread_key_t key, const void *value), );
2368_GL_CXXALIAS_RPL (pthread_setspecific, int,
2369 (pthread_key_t key, const void *value));
2370# else
2371# if !1
2372_GL_FUNCDECL_SYS (pthread_setspecific, int,
2373 (pthread_key_t key, const void *value), );
2374# endif
2375_GL_CXXALIAS_SYS (pthread_setspecific, int,
2376 (pthread_key_t key, const void *value));
2377# endif
2378# if __GLIBC__ >= 2
2379_GL_CXXALIASWARN (pthread_setspecific);
2380# endif
2381#elif defined GNULIB_POSIXCHECK
2382# undef pthread_setspecific
2383# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC
2384_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - "
2385 "use gnulib module pthread-tss for portability");
2386# endif
2387#endif
2388
2389#if 0
2390# if 0
2391# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2392# undef pthread_getspecific
2393# define pthread_getspecific rpl_pthread_getspecific
2394# endif
2395_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key), );
2396_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key));
2397# else
2398# if !1
2399_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key), );
2400# endif
2401_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key));
2402# endif
2403# if __GLIBC__ >= 2
2404_GL_CXXALIASWARN (pthread_getspecific);
2405# endif
2406#elif defined GNULIB_POSIXCHECK
2407# undef pthread_getspecific
2408# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC
2409_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - "
2410 "use gnulib module pthread-tss for portability");
2411# endif
2412#endif
2413
2414#if 0
2415# if 0
2416# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2417# undef pthread_key_delete
2418# define pthread_key_delete rpl_pthread_key_delete
2419# endif
2420_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key), );
2421_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key));
2422# else
2423# if !1
2424_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key), );
2425# endif
2426_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key));
2427# endif
2428# if __GLIBC__ >= 2
2429_GL_CXXALIASWARN (pthread_key_delete);
2430# endif
2431#elif defined GNULIB_POSIXCHECK
2432# undef pthread_key_delete
2433# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE
2434_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - "
2435 "use gnulib module pthread-tss for portability");
2436# endif
2437#endif
2438
2439/* =========== Spinlock functions =========== */
2440
2441#if 0
2442# if 0
2443# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2444# undef pthread_spin_init
2445# define pthread_spin_init rpl_pthread_spin_init
2446# endif
2447_GL_FUNCDECL_RPL (pthread_spin_init, int,
2448 (pthread_spinlock_t *lock, int shared_across_processes),
2449 _GL_ARG_NONNULL ((1)));
2450_GL_CXXALIAS_RPL (pthread_spin_init, int,
2451 (pthread_spinlock_t *lock, int shared_across_processes));
2452# else
2453# if !1
2454_GL_FUNCDECL_SYS (pthread_spin_init, int,
2455 (pthread_spinlock_t *lock, int shared_across_processes),
2456 _GL_ARG_NONNULL ((1)));
2457# endif
2458_GL_CXXALIAS_SYS (pthread_spin_init, int,
2459 (pthread_spinlock_t *lock, int shared_across_processes));
2460# endif
2461# if __GLIBC__ >= 2
2462_GL_CXXALIASWARN (pthread_spin_init);
2463# endif
2464#elif defined GNULIB_POSIXCHECK
2465# undef pthread_spin_init
2466# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT
2467_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - "
2468 "use gnulib module pthread-spin for portability");
2469# endif
2470#endif
2471
2472#if 0
2473# if 0
2474# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2475# undef pthread_spin_lock
2476# define pthread_spin_lock rpl_pthread_spin_lock
2477# endif
2478_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock),
2479 _GL_ARG_NONNULL ((1)));
2480_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock));
2481# else
2482# if !1
2483_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock),
2484 _GL_ARG_NONNULL ((1)));
2485# endif
2486_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock));
2487# endif
2488# if __GLIBC__ >= 2
2489_GL_CXXALIASWARN (pthread_spin_lock);
2490# endif
2491#elif defined GNULIB_POSIXCHECK
2492# undef pthread_spin_lock
2493# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK
2494_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - "
2495 "use gnulib module pthread-spin for portability");
2496# endif
2497#endif
2498
2499#if 0
2500# if 0
2501# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2502# undef pthread_spin_trylock
2503# define pthread_spin_trylock rpl_pthread_spin_trylock
2504# endif
2505_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock),
2506 _GL_ARG_NONNULL ((1)));
2507_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
2508# else
2509# if !1
2510_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock),
2511 _GL_ARG_NONNULL ((1)));
2512# endif
2513_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
2514# endif
2515# if __GLIBC__ >= 2
2516_GL_CXXALIASWARN (pthread_spin_trylock);
2517# endif
2518#elif defined GNULIB_POSIXCHECK
2519# undef pthread_spin_trylock
2520# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK
2521_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - "
2522 "use gnulib module pthread-spin for portability");
2523# endif
2524#endif
2525
2526#if 0
2527# if 0
2528# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2529# undef pthread_spin_unlock
2530# define pthread_spin_unlock rpl_pthread_spin_unlock
2531# endif
2532_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock),
2533 _GL_ARG_NONNULL ((1)));
2534_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
2535# else
2536# if !1
2537_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock),
2538 _GL_ARG_NONNULL ((1)));
2539# endif
2540_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
2541# endif
2542# if __GLIBC__ >= 2
2543_GL_CXXALIASWARN (pthread_spin_unlock);
2544# endif
2545#elif defined GNULIB_POSIXCHECK
2546# undef pthread_spin_unlock
2547# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK
2548_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - "
2549 "use gnulib module pthread-spin for portability");
2550# endif
2551#endif
2552
2553#if 0
2554# if 0
2555# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2556# undef pthread_spin_destroy
2557# define pthread_spin_destroy rpl_pthread_spin_destroy
2558# endif
2559_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock),
2560 _GL_ARG_NONNULL ((1)));
2561_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
2562# else
2563# if !1
2564_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock),
2565 _GL_ARG_NONNULL ((1)));
2566# endif
2567_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
2568# endif
2569# if __GLIBC__ >= 2
2570_GL_CXXALIASWARN (pthread_spin_destroy);
2571# endif
2572#elif defined GNULIB_POSIXCHECK
2573# undef pthread_spin_destroy
2574# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY
2575_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - "
2576 "use gnulib module pthread-spin for portability");
2577# endif
2578#endif
2579
2580
2581#if defined __cplusplus && defined GNULIB_NAMESPACE && !1 && defined __MINGW32__
2582/* Provide the symbols required by mingw's <bits/gthr-default.h>. */
2583using GNULIB_NAMESPACE::pthread_create;
2584using GNULIB_NAMESPACE::pthread_self;
2585using GNULIB_NAMESPACE::pthread_equal;
2586using GNULIB_NAMESPACE::pthread_detach;
2587using GNULIB_NAMESPACE::pthread_join;
2588using GNULIB_NAMESPACE::pthread_once;
2589using GNULIB_NAMESPACE::pthread_mutex_init;
2590using GNULIB_NAMESPACE::pthread_mutexattr_init;
2591using GNULIB_NAMESPACE::pthread_mutexattr_settype;
2592using GNULIB_NAMESPACE::pthread_mutexattr_destroy;
2593using GNULIB_NAMESPACE::pthread_mutex_lock;
2594using GNULIB_NAMESPACE::pthread_mutex_trylock;
2595using GNULIB_NAMESPACE::pthread_mutex_timedlock;
2596using GNULIB_NAMESPACE::pthread_mutex_unlock;
2597using GNULIB_NAMESPACE::pthread_mutex_destroy;
2598using GNULIB_NAMESPACE::pthread_cond_wait;
2599using GNULIB_NAMESPACE::pthread_cond_timedwait;
2600using GNULIB_NAMESPACE::pthread_cond_signal;
2601using GNULIB_NAMESPACE::pthread_cond_broadcast;
2602using GNULIB_NAMESPACE::pthread_cond_destroy;
2603using GNULIB_NAMESPACE::pthread_key_create;
2604using GNULIB_NAMESPACE::pthread_setspecific;
2605using GNULIB_NAMESPACE::pthread_getspecific;
2606using GNULIB_NAMESPACE::pthread_key_delete;
2607#endif
2608
2609
2610#endif /* _GL_PTHREAD_H_ */
2611#endif /* _GL_PTHREAD_H_ */
2612#endif