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
|
|
|
|
|
|
|
#ifdef __GLIBC__
|
|
|
|
#define __need_NULL
|
|
|
|
#define __need_ptrdiff_t
|
|
|
|
#define __need_size_t
|
2010-08-22 02:02:43 +02:00
|
|
|
#endif // __GLIBC__
|
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;
|
|
|
|
|
|
|
|
typedef long double max_align_t;
|
|
|
|
|
|
|
|
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
|
|
|
|
2010-09-21 23:28:23 +02:00
|
|
|
struct _LIBCPP_VISIBLE nullptr_t
|
2010-05-11 21:42:16 +02:00
|
|
|
{
|
|
|
|
void* _;
|
|
|
|
|
|
|
|
struct __nat {int __for_bool_;};
|
|
|
|
|
|
|
|
_LIBCPP_ALWAYS_INLINE nullptr_t(int __nat::*) {}
|
|
|
|
|
|
|
|
_LIBCPP_ALWAYS_INLINE operator int __nat::*() const {return 0;}
|
|
|
|
|
2010-05-18 19:32:30 +02:00
|
|
|
template <class _Tp>
|
2010-08-22 02:02:43 +02:00
|
|
|
_LIBCPP_ALWAYS_INLINE
|
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
|
|
|
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator==(nullptr_t, nullptr_t) {return true;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator!=(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator<(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, nullptr_t) {return true;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, nullptr_t) {return false;}
|
|
|
|
friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, nullptr_t) {return true;}
|
|
|
|
};
|
|
|
|
|
|
|
|
inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
|
|
|
|
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
|