2010-05-11 21:42:16 +02:00
|
|
|
// -*- C++ -*-
|
|
|
|
//===--------------------------- cstddef ----------------------------------===//
|
|
|
|
//
|
2010-05-11 23:36:01 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP_CSTDDEF
|
|
|
|
#define _LIBCPP_CSTDDEF
|
|
|
|
|
|
|
|
/*
|
|
|
|
cstddef synopsis
|
|
|
|
|
|
|
|
Macros:
|
|
|
|
|
|
|
|
offsetof(type,member-designator)
|
|
|
|
NULL
|
2010-08-22 02:02:43 +02:00
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
Types:
|
|
|
|
|
|
|
|
ptrdiff_t
|
|
|
|
size_t
|
|
|
|
max_align_t
|
|
|
|
nullptr_t
|
|
|
|
|
|
|
|
} // std
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <__config>
|
2010-06-02 20:53:22 +02:00
|
|
|
|
2010-05-28 20:04:31 +02:00
|
|
|
#include <stddef.h>
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2011-10-17 22:05:10 +02:00
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
2010-05-11 21:42:16 +02:00
|
|
|
#pragma GCC system_header
|
2011-10-17 22:05:10 +02:00
|
|
|
#endif
|
2010-05-11 21:42:16 +02:00
|
|
|
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
|
|
|
|
using ::ptrdiff_t;
|
|
|
|
using ::size_t;
|
|
|
|
|
2014-02-21 09:37:30 +01:00
|
|
|
#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
|
|
|
|
// Re-use the compiler's <stddef.h> max_align_t where possible.
|
|
|
|
using ::max_align_t;
|
|
|
|
#else
|
2010-05-11 21:42:16 +02:00
|
|
|
typedef long double max_align_t;
|
2014-02-21 09:37:30 +01:00
|
|
|
#endif
|
2010-05-11 21:42:16 +02:00
|
|
|
|
|
|
|
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
|
|
|
|
2013-08-12 20:38:34 +02:00
|
|
|
struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
|
2010-05-11 21:42:16 +02:00
|
|
|
{
|
2012-10-30 20:06:59 +01:00
|
|
|
void* __lx;
|
2010-05-11 21:42:16 +02:00
|
|
|
|
|
|
|
struct __nat {int __for_bool_;};
|
|
|
|
|
2012-10-30 20:06:59 +01:00
|
|
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}
|
|
|
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2012-09-25 01:36:40 +02:00
|
|
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2010-05-18 19:32:30 +02:00
|
|
|
template <class _Tp>
|
2012-09-25 01:36:40 +02:00
|
|
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR
|
2010-05-18 19:32:30 +02:00
|
|
|
operator _Tp* () const {return 0;}
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2010-05-18 19:32:30 +02:00
|
|
|
template <class _Tp, class _Up>
|
2010-08-22 02:02:43 +02:00
|
|
|
_LIBCPP_ALWAYS_INLINE
|
2010-05-18 19:32:30 +02:00
|
|
|
operator _Tp _Up::* () const {return 0;}
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2012-09-25 01:36:40 +02:00
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;}
|
2010-05-11 21:42:16 +02:00
|
|
|
};
|
|
|
|
|
2012-09-25 01:36:40 +02:00
|
|
|
inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2011-06-30 23:18:19 +02:00
|
|
|
#define nullptr _VSTD::__get_nullptr_t()
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2010-08-22 02:02:43 +02:00
|
|
|
#endif // _LIBCPP_HAS_NO_NULLPTR
|
2010-05-11 21:42:16 +02:00
|
|
|
|
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
|
2011-06-05 15:00:46 +02:00
|
|
|
#ifndef _LIBCPP_HAS_NO_NULLPTR
|
|
|
|
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
typedef decltype(nullptr) nullptr_t;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _LIBCPP_HAS_NO_NULLPTR
|
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
#endif // _LIBCPP_CSTDDEF
|