Home | History | Annotate | Download | only in depr.c.headers
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <stddef.h>
     11 
     12 #include <stddef.h>
     13 #include <type_traits>
     14 
     15 #ifndef NULL
     16 #error NULL not defined
     17 #endif
     18 
     19 #ifndef offsetof
     20 #error offsetof not defined
     21 #endif
     22 
     23 int main()
     24 {
     25     static_assert(sizeof(size_t) == sizeof(void*),
     26                   "sizeof(size_t) == sizeof(void*)");
     27     static_assert(std::is_unsigned<size_t>::value,
     28                   "std::is_unsigned<size_t>::value");
     29     static_assert(std::is_integral<size_t>::value,
     30                   "std::is_integral<size_t>::value");
     31     static_assert(sizeof(ptrdiff_t) == sizeof(void*),
     32                   "sizeof(ptrdiff_t) == sizeof(void*)");
     33     static_assert(std::is_signed<ptrdiff_t>::value,
     34                   "std::is_signed<ptrdiff_t>::value");
     35     static_assert(std::is_integral<ptrdiff_t>::value,
     36                   "std::is_integral<ptrdiff_t>::value");
     37 }
     38