Richard Smith | f88eeb7 | 2015-10-08 22:25:27 +0000 | [diff] [blame^] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- stddef.h ---------------------------------===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #if defined(__need_ptrdiff_t) || defined(__need_size_t) || \ |
| 12 | defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t) |
| 13 | #include_next <stddef.h> |
| 14 | |
| 15 | #elif !defined(_LIBCPP_STDDEF_H) |
| 16 | #define _LIBCPP_STDDEF_H |
| 17 | |
| 18 | /* |
| 19 | stddef.h synopsis |
| 20 | |
| 21 | Macros: |
| 22 | |
| 23 | offsetof(type,member-designator) |
| 24 | NULL |
| 25 | |
| 26 | Types: |
| 27 | |
| 28 | ptrdiff_t |
| 29 | size_t |
| 30 | max_align_t |
| 31 | nullptr_t |
| 32 | |
| 33 | */ |
| 34 | |
| 35 | #include <__config> |
| 36 | #include_next <stddef.h> |
| 37 | |
| 38 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 39 | #pragma GCC system_header |
| 40 | #endif |
| 41 | |
| 42 | #ifdef __cplusplus |
| 43 | |
| 44 | extern "C++" { |
| 45 | #include <__nullptr> |
| 46 | using std::nullptr_t; |
| 47 | } |
| 48 | |
| 49 | // Re-use the compiler's <stddef.h> max_align_t where possible. |
| 50 | #if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) |
| 51 | typedef long double max_align_t; |
| 52 | #endif |
| 53 | |
| 54 | #endif |
| 55 | |
| 56 | #endif // _LIBCPP_STDDEF_H |