1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Substitute for <sys/random.h>.
3    Copyright (C) 2020-2021 Free Software Foundation, Inc.
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3, or (at your option)
8    any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
17 
18 # if __GNUC__ >= 3
19 #pragma GCC system_header
20 # endif
21 
22 
23 #ifndef _GL_SYS_RANDOM_H
24 
25 #if 1
26 
27 /* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
28 # if defined __UCLIBC__
29 #  include <stddef.h>
30 # endif
31 /* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
32    On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that
33    includes <Availability.h>, such as <stdlib.h> or <unistd.h>.  */
34 # if defined __APPLE__ && defined __MACH__                  /* Mac OS X */
35 #  include <sys/types.h>
36 #  include <stdlib.h>
37 # endif
38 
39 /* The include_next requires a split double-inclusion guard.  */
40 # include_next <sys/random.h>
41 
42 #endif
43 
44 #ifndef _GL_SYS_RANDOM_H
45 #define _GL_SYS_RANDOM_H
46 
47 #include <sys/types.h>
48 
49 /* Define the GRND_* constants.  */
50 #ifndef GRND_NONBLOCK
51 # define GRND_NONBLOCK 1
52 # define GRND_RANDOM 2
53 #endif
54 
55 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
56 /* C++ compatible function declaration macros.
57    Copyright (C) 2010-2021 Free Software Foundation, Inc.
58 
59    This program is free software: you can redistribute it and/or modify it
60    under the terms of the GNU General Public License as published
61    by the Free Software Foundation; either version 3 of the License, or
62    (at your option) any later version.
63 
64    This program is distributed in the hope that it will be useful,
65    but WITHOUT ANY WARRANTY; without even the implied warranty of
66    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
67    General Public License for more details.
68 
69    You should have received a copy of the GNU General Public License
70    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
71 
72 #ifndef _GL_CXXDEFS_H
73 #define _GL_CXXDEFS_H
74 
75 /* Begin/end the GNULIB_NAMESPACE namespace.  */
76 #if defined __cplusplus && defined GNULIB_NAMESPACE
77 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
78 # define _GL_END_NAMESPACE }
79 #else
80 # define _GL_BEGIN_NAMESPACE
81 # define _GL_END_NAMESPACE
82 #endif
83 
84 /* The three most frequent use cases of these macros are:
85 
86    * For providing a substitute for a function that is missing on some
87      platforms, but is declared and works fine on the platforms on which
88      it exists:
89 
90        #if @GNULIB_FOO@
91        # if !@HAVE_FOO@
92        _GL_FUNCDECL_SYS (foo, ...);
93        # endif
94        _GL_CXXALIAS_SYS (foo, ...);
95        _GL_CXXALIASWARN (foo);
96        #elif defined GNULIB_POSIXCHECK
97        ...
98        #endif
99 
100    * For providing a replacement for a function that exists on all platforms,
101      but is broken/insufficient and needs to be replaced on some platforms:
102 
103        #if @GNULIB_FOO@
104        # if @REPLACE_FOO@
105        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
106        #   undef foo
107        #   define foo rpl_foo
108        #  endif
109        _GL_FUNCDECL_RPL (foo, ...);
110        _GL_CXXALIAS_RPL (foo, ...);
111        # else
112        _GL_CXXALIAS_SYS (foo, ...);
113        # endif
114        _GL_CXXALIASWARN (foo);
115        #elif defined GNULIB_POSIXCHECK
116        ...
117        #endif
118 
119    * For providing a replacement for a function that exists on some platforms
120      but is broken/insufficient and needs to be replaced on some of them and
121      is additionally either missing or undeclared on some other platforms:
122 
123        #if @GNULIB_FOO@
124        # if @REPLACE_FOO@
125        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
126        #   undef foo
127        #   define foo rpl_foo
128        #  endif
129        _GL_FUNCDECL_RPL (foo, ...);
130        _GL_CXXALIAS_RPL (foo, ...);
131        # else
132        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
133        _GL_FUNCDECL_SYS (foo, ...);
134        #  endif
135        _GL_CXXALIAS_SYS (foo, ...);
136        # endif
137        _GL_CXXALIASWARN (foo);
138        #elif defined GNULIB_POSIXCHECK
139        ...
140        #endif
141 */
142 
143 /* _GL_EXTERN_C declaration;
144    performs the declaration with C linkage.  */
145 #if defined __cplusplus
146 # define _GL_EXTERN_C extern "C"
147 #else
148 # define _GL_EXTERN_C extern
149 #endif
150 
151 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
152    declares a replacement function, named rpl_func, with the given prototype,
153    consisting of return type, parameters, and attributes.
154    Example:
155      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
156                                   _GL_ARG_NONNULL ((1)));
157  */
158 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
159   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
160 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
161   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
162 
163 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
164    declares the system function, named func, with the given prototype,
165    consisting of return type, parameters, and attributes.
166    Example:
167      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
168                                   _GL_ARG_NONNULL ((1)));
169  */
170 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
171   _GL_EXTERN_C rettype func parameters_and_attributes
172 
173 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
174    declares a C++ alias called GNULIB_NAMESPACE::func
175    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
176    Example:
177      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
178 
179    Wrapping rpl_func in an object with an inline conversion operator
180    avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
181    actually used in the program.  */
182 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
183   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
184 #if defined __cplusplus && defined GNULIB_NAMESPACE
185 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
186     namespace GNULIB_NAMESPACE                                \
187     {                                                         \
188       static const struct _gl_ ## func ## _wrapper            \
189       {                                                       \
190         typedef rettype (*type) parameters;                   \
191                                                               \
192         inline operator type () const                         \
193         {                                                     \
194           return ::rpl_func;                                  \
195         }                                                     \
196       } func = {};                                            \
197     }                                                         \
198     _GL_EXTERN_C int _gl_cxxalias_dummy
199 #else
200 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
201     _GL_EXTERN_C int _gl_cxxalias_dummy
202 #endif
203 
204 /* _GL_CXXALIAS_MDA (func, rettype, parameters);
205    is to be used when func is a Microsoft deprecated alias, on native Windows.
206    It declares a C++ alias called GNULIB_NAMESPACE::func
207    that redirects to _func, if GNULIB_NAMESPACE is defined.
208    Example:
209      _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
210  */
211 #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
212   _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
213 
214 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
215    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
216    except that the C function rpl_func may have a slightly different
217    declaration.  A cast is used to silence the "invalid conversion" error
218    that would otherwise occur.  */
219 #if defined __cplusplus && defined GNULIB_NAMESPACE
220 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
221     namespace GNULIB_NAMESPACE                                     \
222     {                                                              \
223       static const struct _gl_ ## func ## _wrapper                 \
224       {                                                            \
225         typedef rettype (*type) parameters;                        \
226                                                                    \
227         inline operator type () const                              \
228         {                                                          \
229           return reinterpret_cast<type>(::rpl_func);               \
230         }                                                          \
231       } func = {};                                                 \
232     }                                                              \
233     _GL_EXTERN_C int _gl_cxxalias_dummy
234 #else
235 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
236     _GL_EXTERN_C int _gl_cxxalias_dummy
237 #endif
238 
239 /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
240    is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
241    except that the C function func may have a slightly different declaration.
242    A cast is used to silence the "invalid conversion" error that would
243    otherwise occur.  */
244 #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
245   _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
246 
247 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
248    declares a C++ alias called GNULIB_NAMESPACE::func
249    that redirects to the system provided function func, if GNULIB_NAMESPACE
250    is defined.
251    Example:
252      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
253 
254    Wrapping func in an object with an inline conversion operator
255    avoids a reference to func unless GNULIB_NAMESPACE::func is
256    actually used in the program.  */
257 #if defined __cplusplus && defined GNULIB_NAMESPACE
258 # define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
259     namespace GNULIB_NAMESPACE                                \
260     {                                                         \
261       static const struct _gl_ ## func ## _wrapper            \
262       {                                                       \
263         typedef rettype (*type) parameters;                   \
264                                                               \
265         inline operator type () const                         \
266         {                                                     \
267           return ::func;                                      \
268         }                                                     \
269       } func = {};                                            \
270     }                                                         \
271     _GL_EXTERN_C int _gl_cxxalias_dummy
272 #else
273 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
274     _GL_EXTERN_C int _gl_cxxalias_dummy
275 #endif
276 
277 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
278    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
279    except that the C function func may have a slightly different declaration.
280    A cast is used to silence the "invalid conversion" error that would
281    otherwise occur.  */
282 #if defined __cplusplus && defined GNULIB_NAMESPACE
283 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
284     namespace GNULIB_NAMESPACE                          \
285     {                                                   \
286       static const struct _gl_ ## func ## _wrapper      \
287       {                                                 \
288         typedef rettype (*type) parameters;             \
289                                                         \
290         inline operator type () const                   \
291         {                                               \
292           return reinterpret_cast<type>(::func);        \
293         }                                               \
294       } func = {};                                      \
295     }                                                   \
296     _GL_EXTERN_C int _gl_cxxalias_dummy
297 #else
298 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
299     _GL_EXTERN_C int _gl_cxxalias_dummy
300 #endif
301 
302 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
303    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
304    except that the C function is picked among a set of overloaded functions,
305    namely the one with rettype2 and parameters2.  Two consecutive casts
306    are used to silence the "cannot find a match" and "invalid conversion"
307    errors that would otherwise occur.  */
308 #if defined __cplusplus && defined GNULIB_NAMESPACE
309   /* The outer cast must be a reinterpret_cast.
310      The inner cast: When the function is defined as a set of overloaded
311      functions, it works as a static_cast<>, choosing the designated variant.
312      When the function is defined as a single variant, it works as a
313      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
314 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
315     namespace GNULIB_NAMESPACE                                                \
316     {                                                                         \
317       static const struct _gl_ ## func ## _wrapper                            \
318       {                                                                       \
319         typedef rettype (*type) parameters;                                   \
320                                                                               \
321         inline operator type () const                                         \
322         {                                                                     \
323           return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
324         }                                                                     \
325       } func = {};                                                            \
326     }                                                                         \
327     _GL_EXTERN_C int _gl_cxxalias_dummy
328 #else
329 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
330     _GL_EXTERN_C int _gl_cxxalias_dummy
331 #endif
332 
333 /* _GL_CXXALIASWARN (func);
334    causes a warning to be emitted when ::func is used but not when
335    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
336    variants.  */
337 #if defined __cplusplus && defined GNULIB_NAMESPACE
338 # define _GL_CXXALIASWARN(func) \
339    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
340 # define _GL_CXXALIASWARN_1(func,namespace) \
341    _GL_CXXALIASWARN_2 (func, namespace)
342 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
343    we enable the warning only when not optimizing.  */
344 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
345 #  define _GL_CXXALIASWARN_2(func,namespace) \
346     _GL_WARN_ON_USE (func, \
347                      "The symbol ::" #func " refers to the system function. " \
348                      "Use " #namespace "::" #func " instead.")
349 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
350 #  define _GL_CXXALIASWARN_2(func,namespace) \
351      extern __typeof__ (func) func
352 # else
353 #  define _GL_CXXALIASWARN_2(func,namespace) \
354      _GL_EXTERN_C int _gl_cxxalias_dummy
355 # endif
356 #else
357 # define _GL_CXXALIASWARN(func) \
358     _GL_EXTERN_C int _gl_cxxalias_dummy
359 #endif
360 
361 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
362    causes a warning to be emitted when the given overloaded variant of ::func
363    is used but not when GNULIB_NAMESPACE::func is used.  */
364 #if defined __cplusplus && defined GNULIB_NAMESPACE
365 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
366    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
367                         GNULIB_NAMESPACE)
368 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
369    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
370 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
371    we enable the warning only when not optimizing.  */
372 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
373 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
374     _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
375                          "The symbol ::" #func " refers to the system function. " \
376                          "Use " #namespace "::" #func " instead.")
377 # else
378 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
379      _GL_EXTERN_C int _gl_cxxalias_dummy
380 # endif
381 #else
382 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
383     _GL_EXTERN_C int _gl_cxxalias_dummy
384 #endif
385 
386 #endif /* _GL_CXXDEFS_H */
387 
388 /* The definition of _GL_ARG_NONNULL is copied here.  */
389 /* A C macro for declaring that specific arguments must not be NULL.
390    Copyright (C) 2009-2021 Free Software Foundation, Inc.
391 
392    This program is free software: you can redistribute it and/or modify it
393    under the terms of the GNU General Public License as published
394    by the Free Software Foundation; either version 3 of the License, or
395    (at your option) any later version.
396 
397    This program is distributed in the hope that it will be useful,
398    but WITHOUT ANY WARRANTY; without even the implied warranty of
399    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
400    General Public License for more details.
401 
402    You should have received a copy of the GNU General Public License
403    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
404 
405 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
406    that the values passed as arguments n, ..., m must be non-NULL pointers.
407    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
408 #ifndef _GL_ARG_NONNULL
409 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
410 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
411 # else
412 #  define _GL_ARG_NONNULL(params)
413 # endif
414 #endif
415 
416 /* The definition of _GL_WARN_ON_USE is copied here.  */
417 /* A C macro for emitting warnings if a function is used.
418    Copyright (C) 2010-2021 Free Software Foundation, Inc.
419 
420    This program is free software: you can redistribute it and/or modify it
421    under the terms of the GNU General Public License as published
422    by the Free Software Foundation; either version 3 of the License, or
423    (at your option) any later version.
424 
425    This program is distributed in the hope that it will be useful,
426    but WITHOUT ANY WARRANTY; without even the implied warranty of
427    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
428    General Public License for more details.
429 
430    You should have received a copy of the GNU General Public License
431    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
432 
433 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
434    for FUNCTION which will then trigger a compiler warning containing
435    the text of "literal string" anywhere that function is called, if
436    supported by the compiler.  If the compiler does not support this
437    feature, the macro expands to an unused extern declaration.
438 
439    _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
440    attribute used in _GL_WARN_ON_USE.  If the compiler does not support
441    this feature, it expands to empty.
442 
443    These macros are useful for marking a function as a potential
444    portability trap, with the intent that "literal string" include
445    instructions on the replacement function that should be used
446    instead.
447    _GL_WARN_ON_USE is for functions with 'extern' linkage.
448    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
449    linkage.
450 
451    However, one of the reasons that a function is a portability trap is
452    if it has the wrong signature.  Declaring FUNCTION with a different
453    signature in C is a compilation error, so this macro must use the
454    same type as any existing declaration so that programs that avoid
455    the problematic FUNCTION do not fail to compile merely because they
456    included a header that poisoned the function.  But this implies that
457    _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
458    have a declaration.  Use of this macro implies that there must not
459    be any other macro hiding the declaration of FUNCTION; but
460    undefining FUNCTION first is part of the poisoning process anyway
461    (although for symbols that are provided only via a macro, the result
462    is a compilation error rather than a warning containing
463    "literal string").  Also note that in C++, it is only safe to use if
464    FUNCTION has no overloads.
465 
466    For an example, it is possible to poison 'getline' by:
467    - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
468      [getline]) in configure.ac, which potentially defines
469      HAVE_RAW_DECL_GETLINE
470    - adding this code to a header that wraps the system <stdio.h>:
471      #undef getline
472      #if HAVE_RAW_DECL_GETLINE
473      _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
474        "not universally present; use the gnulib module getline");
475      #endif
476 
477    It is not possible to directly poison global variables.  But it is
478    possible to write a wrapper accessor function, and poison that
479    (less common usage, like &environ, will cause a compilation error
480    rather than issue the nice warning, but the end result of informing
481    the developer about their portability problem is still achieved):
482      #if HAVE_RAW_DECL_ENVIRON
483      static char ***
484      rpl_environ (void) { return &environ; }
485      _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
486      # undef environ
487      # define environ (*rpl_environ ())
488      #endif
489    or better (avoiding contradictory use of 'static' and 'extern'):
490      #if HAVE_RAW_DECL_ENVIRON
491      static char ***
492      _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
493      rpl_environ (void) { return &environ; }
494      # undef environ
495      # define environ (*rpl_environ ())
496      #endif
497    */
498 #ifndef _GL_WARN_ON_USE
499 
500 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
501 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
502 #  define _GL_WARN_ON_USE(function, message) \
503 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
504 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
505   __attribute__ ((__warning__ (message)))
506 # elif __clang_major__ >= 4
507 /* Another compiler attribute is available in clang.  */
508 #  define _GL_WARN_ON_USE(function, message) \
509 extern __typeof__ (function) function \
510   __attribute__ ((__diagnose_if__ (1, message, "warning")))
511 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
512   __attribute__ ((__diagnose_if__ (1, message, "warning")))
513 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
514 /* Verify the existence of the function.  */
515 #  define _GL_WARN_ON_USE(function, message) \
516 extern __typeof__ (function) function
517 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
518 # else /* Unsupported.  */
519 #  define _GL_WARN_ON_USE(function, message) \
520 _GL_WARN_EXTERN_C int _gl_warn_on_use
521 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
522 # endif
523 #endif
524 
525 /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
526    is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
527    function is declared with the given prototype, consisting of return type,
528    parameters, and attributes.
529    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
530    not work in this case.  */
531 #ifndef _GL_WARN_ON_USE_CXX
532 # if !defined __cplusplus
533 #  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
534      _GL_WARN_ON_USE (function, msg)
535 # else
536 #  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
537 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
538 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
539 extern rettype_gcc function parameters_and_attributes \
540   __attribute__ ((__warning__ (msg)))
541 #  elif __clang_major__ >= 4
542 /* Another compiler attribute is available in clang.  */
543 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
544 extern rettype_clang function parameters_and_attributes \
545   __attribute__ ((__diagnose_if__ (1, msg, "warning")))
546 #  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
547 /* Verify the existence of the function.  */
548 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
549 extern rettype_gcc function parameters_and_attributes
550 #  else /* Unsupported.  */
551 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
552 _GL_WARN_EXTERN_C int _gl_warn_on_use
553 #  endif
554 # endif
555 #endif
556 
557 /* _GL_WARN_EXTERN_C declaration;
558    performs the declaration with C linkage.  */
559 #ifndef _GL_WARN_EXTERN_C
560 # if defined __cplusplus
561 #  define _GL_WARN_EXTERN_C extern "C"
562 # else
563 #  define _GL_WARN_EXTERN_C extern
564 # endif
565 #endif
566 
567 
568 /* Declare overridden functions.  */
569 
570 
571 #if 1
572 /* Fill a buffer with random bytes.  */
573 # if 0
574 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
575 #   undef getrandom
576 #   define getrandom rpl_getrandom
577 #  endif
578 _GL_FUNCDECL_RPL (getrandom, ssize_t,
579                   (void *buffer, size_t length, unsigned int flags)
580                   _GL_ARG_NONNULL ((1)));
581 _GL_CXXALIAS_RPL (getrandom, ssize_t,
582                   (void *buffer, size_t length, unsigned int flags));
583 # else
584 #  if !1
585 _GL_FUNCDECL_SYS (getrandom, ssize_t,
586                   (void *buffer, size_t length, unsigned int flags)
587                   _GL_ARG_NONNULL ((1)));
588 #  endif
589 _GL_CXXALIAS_SYS (getrandom, ssize_t,
590                   (void *buffer, size_t length, unsigned int flags));
591 # endif
592 _GL_CXXALIASWARN (getrandom);
593 #elif defined GNULIB_POSIXCHECK
594 # undef getrandom
595 # if HAVE_RAW_DECL_GETRANDOM
596 _GL_WARN_ON_USE (getrandom, "getrandom is unportable - "
597                  "use gnulib module getrandom for portability");
598 # endif
599 #endif
600 
601 
602 #endif /* _GL_SYS_RANDOM_H */
603 #endif /* _GL_SYS_RANDOM_H */
604