xref: /OK3568_Linux_fs/buildroot/package/musl-compat-headers/cdefs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* Copyright (C) 2016 Yann E. MORIN <yann.morin.1998@free.fr>
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * This file is in the Public Domain.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * For jurisdictions in which the Public Domain does not exist
6*4882a593Smuzhiyun  * or it is not otherwise applicable, this file is licensed CC0
7*4882a593Smuzhiyun  * (Creative Commons Zero).
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun /* This file contains definitions for non-standard macros defined by
11*4882a593Smuzhiyun  * glibc, but quite commonly used in packages.
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * Because they are non-standard, musl does not define those macros.
14*4882a593Smuzhiyun  * It does not provide cdefs.h either.
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  * This file is a compatibility header written from scratch, to be
17*4882a593Smuzhiyun  * installed when the C library is musl.
18*4882a593Smuzhiyun  *
19*4882a593Smuzhiyun  * Not all macros from the glibc's cdefs.h are available, only the
20*4882a593Smuzhiyun  * most commonly used ones.
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  * Please refer to the glibc documentation and source code for
23*4882a593Smuzhiyun  * explanations about those macros.
24*4882a593Smuzhiyun  */
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #ifndef BUILDROOT_SYS_CDEFS_H
27*4882a593Smuzhiyun #define BUILDROOT_SYS_CDEFS_H
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /* Function prototypes. */
30*4882a593Smuzhiyun #undef __P
31*4882a593Smuzhiyun #define __P(arg) arg
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun /* C declarations in C++ mode. */
34*4882a593Smuzhiyun #ifdef __cplusplus
35*4882a593Smuzhiyun # define __BEGIN_DECLS extern "C" {
36*4882a593Smuzhiyun # define __END_DECLS   }
37*4882a593Smuzhiyun #else
38*4882a593Smuzhiyun # define __BEGIN_DECLS
39*4882a593Smuzhiyun # define __END_DECLS
40*4882a593Smuzhiyun #endif
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun /* Don't throw exceptions in C functions. */
43*4882a593Smuzhiyun #ifndef __cplusplus
44*4882a593Smuzhiyun # define __THROW  __attribute__ ((__nothrow__))
45*4882a593Smuzhiyun # define __NTH(f) __attribute__ ((__nothrow__)) f
46*4882a593Smuzhiyun #else
47*4882a593Smuzhiyun # define __THROW
48*4882a593Smuzhiyun # define __NTH(f) f
49*4882a593Smuzhiyun #endif
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun #endif /* ifndef BUILDROOT_SYS_CDEFS_H */
52