1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
// -*- C++ -*-
//===--------------------------- cstddef ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCUDACXX_CSTDDEF
#define _LIBCUDACXX_CSTDDEF
/*
cstddef synopsis
Macros:
offsetof(type,member-designator)
NULL
namespace std
{
Types:
ptrdiff_t
size_t
max_align_t
nullptr_t
byte // C++17
} // std
*/
#ifndef __cuda_std__
#include <__config>
#include <version>
#include <__pragma_push>
#endif //__cuda_std__
#if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER)
#pragma GCC system_header
#endif
#ifndef __cuda_std__
// Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
#ifdef _MSC_VER
#include <../ucrt/stddef.h>
#else
#include_next <stddef.h>
#endif
#include <__nullptr>
#endif //__cuda_std__
_LIBCUDACXX_BEGIN_NAMESPACE_STD
using ::ptrdiff_t;
using ::size_t;
#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) || \
defined(__DEFINED_max_align_t) || defined(__NetBSD__)
// Re-use the compiler's <stddef.h> max_align_t where possible.
using ::max_align_t;
#else
typedef long double max_align_t;
#endif
_LIBCUDACXX_END_NAMESPACE_STD
#if _LIBCUDACXX_STD_VER > 11
#ifdef _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION
_LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION
#else
namespace std // purposefully not versioned
{
#endif //_LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION
enum class byte : unsigned char {};
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte operator| (byte __lhs, byte __rhs) noexcept
{
return static_cast<byte>(
static_cast<unsigned char>(
static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)
));
}
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
{ return __lhs = __lhs | __rhs; }
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte operator& (byte __lhs, byte __rhs) noexcept
{
return static_cast<byte>(
static_cast<unsigned char>(
static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)
));
}
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept
{ return __lhs = __lhs & __rhs; }
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte operator^ (byte __lhs, byte __rhs) noexcept
{
return static_cast<byte>(
static_cast<unsigned char>(
static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)
));
}
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept
{ return __lhs = __lhs ^ __rhs; }
_LIBCUDACXX_INLINE_VISIBILITY
constexpr byte operator~ (byte __b) noexcept
{
return static_cast<byte>(
static_cast<unsigned char>(
~static_cast<unsigned int>(__b)
));
}
#ifdef _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION
_LIBCUDACXX_END_NAMESPACE_STD_NOVERSION
#else
}
#endif //_LIBCUDACXX_END_NAMESPACE_STD_NOVERSION
#ifndef __cuda_std__
#include <type_traits> // rest of byte
#endif
#endif
#ifndef __cuda_std__
#include <__pragma_pop>
#endif //__cuda_std__
#endif // _LIBCUDACXX_CSTDDEF
|