stddef.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  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. #ifdef _LIBCPP_COMPILER_MSVC
  15. #include _LIBCPP_UCRT_INCLUDE(stddef.h)
  16. #else
  17. #include_next <stddef.h>
  18. #endif
  19. #elif !defined(_LIBCPP_STDDEF_H)
  20. #define _LIBCPP_STDDEF_H
  21. /*
  22. stddef.h synopsis
  23. Macros:
  24. offsetof(type,member-designator)
  25. NULL
  26. Types:
  27. ptrdiff_t
  28. size_t
  29. max_align_t // C++11
  30. nullptr_t
  31. */
  32. #include <__config>
  33. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  34. #pragma GCC system_header
  35. #endif
  36. #ifdef _LIBCPP_COMPILER_MSVC
  37. #include _LIBCPP_UCRT_INCLUDE(stddef.h)
  38. typedef double max_align_t;
  39. #else
  40. #include_next <stddef.h>
  41. #endif
  42. #ifdef __cplusplus
  43. extern "C++" {
  44. #include <__nullptr>
  45. using std::nullptr_t;
  46. }
  47. #endif
  48. #endif // _LIBCPP_STDDEF_H