cdefs.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. /* This file contains definitions for non-standard macros defined by
  10. * glibc, but quite commonly used in packages.
  11. *
  12. * Because they are non-standard, musl does not define those macros.
  13. * It does not provide cdefs.h either.
  14. *
  15. * This file is a compatibility header written from scratch, to be
  16. * installed when the C library is musl.
  17. *
  18. * Not all macros from the glibc's cdefs.h are available, only the
  19. * most commonly used ones.
  20. *
  21. * Please refer to the glibc documentation and source code for
  22. * explanations about those macros.
  23. */
  24. #ifndef BUILDROOT_SYS_CDEFS_H
  25. #define BUILDROOT_SYS_CDEFS_H
  26. /* Function prototypes. */
  27. #undef __P
  28. #define __P(arg) arg
  29. /* C declarations in C++ mode. */
  30. #ifdef __cplusplus
  31. # define __BEGIN_DECLS extern "C" {
  32. # define __END_DECLS }
  33. #else
  34. # define __BEGIN_DECLS
  35. # define __END_DECLS
  36. #endif
  37. /* Don't throw exceptions in C functions. */
  38. #ifndef __cplusplus
  39. # define __THROW __attribute__ ((__nothrow__))
  40. # define __NTH(f) __attribute__ ((__nothrow__)) f
  41. #else
  42. # define __THROW
  43. # define __NTH(f) f
  44. #endif
  45. #endif /* ifndef BUILDROOT_SYS_CDEFS_H */