[ox/std] Fix ptrdiff_t header location

This commit is contained in:
Gary Talent 2021-08-02 21:47:45 -05:00
parent e7bf3d5413
commit 8f6897225a
3 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@
#pragma once #pragma once
#ifndef OX_USE_STDLIB #ifndef OX_USE_STDLIB
#include "types.hpp" #include "stddef.hpp"
namespace std { namespace std {

View File

@ -8,10 +8,16 @@
#pragma once #pragma once
#include "types.hpp"
#ifdef OX_USE_STDLIB #ifdef OX_USE_STDLIB
#include <cstddef> #include <cstddef>
#else #else
#define offsetof(type, member) __builtin_offsetof(type, member) #define offsetof(type, member) __builtin_offsetof(type, member)
namespace std {
using ptrdiff_t = uintptr_t;
}
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -160,10 +160,4 @@ static_assert(sizeof(uint8_t) == 1, "uint8_t is wrong size");
static_assert(sizeof(uint16_t) == 2, "uint16_t is wrong size"); static_assert(sizeof(uint16_t) == 2, "uint16_t is wrong size");
static_assert(sizeof(uint32_t) == 4, "uint32_t is wrong size"); static_assert(sizeof(uint32_t) == 4, "uint32_t is wrong size");
static_assert(sizeof(uint64_t) == 8, "uint64_t is wrong size"); static_assert(sizeof(uint64_t) == 8, "uint64_t is wrong size");
static_assert(sizeof(uintptr_t) == sizeof(void*), "uintptr_t is wrong size"); static_assert(sizeof(uintptr_t) == sizeof(void*), "uintptr_t is wrong size");
#ifndef OX_USE_STDLIB
namespace std {
using ptrdiff_t = uintptr_t;
}
#endif