dl
dl_platform.h
浏览该文件的文档.
1
12#pragma once
13
14#define DL_PLATFORM_ERROR 0
15#define DL_PLATFORM_WIN32 1
16#define DL_PLATFORM_LINUX 2
17#define DL_PLATFORM_ANDROID 3
18
19#define DL_PLATFORM DL_PLATFORM_ERROR
20
21#ifdef _WIN32
22#undef DL_PLATFORM
23#define DL_PLATFORM DL_PLATFORM_WIN32
24#endif
25
26#ifdef __linux__
27#undef DL_PLATFORM
28#define DL_PLATFORM DL_PLATFORM_LINUX
29#endif
30
31#ifdef __ANDROID__
32#undef DL_PLATFORM
33#define DL_PLATFORM DL_PLATFORM_ANDROID
34#endif
35
37consteval bool is_x64()
38{
39 return sizeof(void*) == 8;
40}
41
42#if defined(__LP64__) || defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64)
43#ifndef DL_X64
44#define DL_X64
45#endif
46#endif
47
48#define DL_ENDIAN_LITTLE can-not-use
consteval bool is_x64()
是否64位