5 #if defined(WIN32) || defined(_WIN32) || defined(_MSC_VER) 6 #define PLATFORM_WINDOWS 11 #define PLATFORM_LINUX 12 #define PLATFORM_POSIX 20 template<
typename DstType,
typename SrcType>
24 static_assert(
sizeof(SrcType) ==
sizeof(DstType),
"bit_cast must be between same sized types");
35 template<
typename Type,
unsigned Size = sizeof(Type)>
38 template<
typename Type>
47 template<
typename Type>
52 #ifdef PLATFORM_WINDOWS 54 #elif defined(PLATFORM_APPLE) 58 #elif defined(PLATFORM_LINUX) 64 template<
typename Type>
69 #ifdef PLATFORM_WINDOWS 71 #elif defined(PLATFORM_APPLE) 73 #elif defined(PLATFORM_LINUX) 79 template<
typename Type>
84 #ifdef PLATFORM_WINDOWS 86 #elif defined(PLATFORM_APPLE) 88 #elif defined(PLATFORM_LINUX) 95 template<
typename Type>
103 template<
typename Type>
104 constexpr
inline Type 107 return static_cast<Type>((
static_cast<size_t>(
value) + (alignment - 1)) & ~(alignment - 1));
110 template<
typename Type>
111 constexpr
inline Type 114 return static_cast<Type>(
static_cast<size_t>(
value) & ~(alignment - 1));
117 #define CHECK_SIZE(Type, Size) \ 118 static_assert(sizeof(Type) == Size, \ 119 #Type " must be " #Size " bytes") constexpr Type align_down(Type value, size_t alignment)
Definition: utils.h:112
static INLINE uint32_t bswap_32(uint32_t val)
Definition: xenon360_audio.c:54
static Type swap(Type src)
Definition: utils.h:41
VULKAN_HPP_INLINE void swap(UniqueHandle< Type > &lhs, UniqueHandle< Type > &rhs)
Definition: vulkan.hpp:441
static Type swap(Type src)
Definition: utils.h:67
constexpr Type align_up(Type value, size_t alignment)
Definition: utils.h:105
GLenum src
Definition: glext.h:6980
Type byte_swap(Type src)
Definition: utils.h:97
static Type swap(Type src)
Definition: utils.h:50
static Type swap(Type src)
Definition: utils.h:82
GLsizei const GLfloat * value
Definition: glext.h:6709
Type
Type of JSON value.
Definition: rapidjson.h:603
GLenum GLenum dst
Definition: glext.h:6980
unsigned short uint16_t
Definition: stdint.h:125
DstType bit_cast(const SrcType &src)
Definition: utils.h:22
void * memcpy(void *dst, const void *src, size_t len)
Definition: string.c:26