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