Add word size detection to Platform.h
This commit is contained in:
parent
8f2050540d
commit
60ffbfc071
|
@ -27,4 +27,14 @@
|
||||||
# error "Unsupported platform."
|
# error "Unsupported platform."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN64) || defined(__aarch64__) || defined(__x86_64__)
|
||||||
|
# define NXT_PLATFORM_64_BIT 1
|
||||||
|
static_assert(sizeof(sizeof(char)) == 8, "Expect sizeof(size_t) == 8");
|
||||||
|
#elif defined(_WIN32) || defined(__i386__) || defined(__arm__)
|
||||||
|
# define NXT_PLATFORM_32_BIT 1
|
||||||
|
static_assert(sizeof(sizeof(char)) == 4, "Expect sizeof(size_t) == 4");
|
||||||
|
#else
|
||||||
|
# error "Unsupported platform"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // COMMON_PLATFORM_H_
|
#endif // COMMON_PLATFORM_H_
|
||||||
|
|
Loading…
Reference in New Issue