stddef.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // -*- C++ -*-
  2. //===--------------------------- stddef.h ---------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #if defined(__need_ptrdiff_t) || defined(__need_size_t) || \
  10. defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t)
  11. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  12. #pragma GCC system_header
  13. #endif
  14. #include_next <stddef.h>
  15. #elif !defined(_LIBCPP_STDDEF_H)
  16. #define _LIBCPP_STDDEF_H
  17. /*
  18. stddef.h synopsis
  19. Macros:
  20. offsetof(type,member-designator)
  21. NULL
  22. Types:
  23. ptrdiff_t
  24. size_t
  25. max_align_t
  26. nullptr_t
  27. */
  28. #include <__config>
  29. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  30. #pragma GCC system_header
  31. #endif
  32. #include_next <stddef.h>
  33. #ifdef __cplusplus
  34. extern "C++" {
  35. #include <__nullptr>
  36. using std::nullptr_t;
  37. }
  38. // Re-use the compiler's <stddef.h> max_align_t where possible.
  39. #if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) && \
  40. !defined(__DEFINED_max_align_t) && !defined(__NetBSD__)
  41. typedef long double max_align_t;
  42. #endif
  43. #endif
  44. #endif // _LIBCPP_STDDEF_H