-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathduilib_config.h
66 lines (54 loc) · 1.67 KB
/
duilib_config.h
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
#ifndef DUILIB_CONFIG_H_
#define DUILIB_CONFIG_H_
/** Windows or Linux 平台
*/
#if defined (_WIN32) || defined (_WIN64)
#define DUILIB_BUILD_FOR_WIN 1
//是否使用SDL的窗口和鼠标键盘事件(目前只支持SDL3)
//#define DUILIB_BUILD_FOR_SDL 1
#elif defined(linux) || defined(__linux) || defined(__linux__)
#define DUILIB_BUILD_FOR_LINUX 1
//是否使用SDL的窗口和鼠标键盘事件(目前只支持SDL3)
#define DUILIB_BUILD_FOR_SDL 1
#else
//不支持的系统
#pragma message("Unknown Platform!")
#endif
/** 64位操作系统标识
*/
#if defined(_M_X64) || defined(_M_AMD64) || defined(_WIN64) || defined(__x86_64__)
#define DUILIB_BIT_64 1
#endif
/** Unicode or Ansi 版本(Ansi版本,文件的编码是UTF-8的,所以字符串编码也是UTF-8的)
*/
#if defined(UNICODE) || defined(_UNICODE)
#define DUILIB_UNICODE 1
#endif
//未使用的变量宏,避免编译器报警报
#ifndef UNUSED_VARIABLE
#define UNUSED_VARIABLE(x) ((void)(x))
#endif
#ifndef ASSERT_UNUSED_VARIABLE
#ifdef _DEBUG
#define ASSERT_UNUSED_VARIABLE(expr) ASSERT(expr)
#else
#define ASSERT_UNUSED_VARIABLE(expr) UNUSED_VARIABLE(expr)
#endif
#endif
#if defined DUILIB_BUILD_FOR_WIN
#include "duilib_config_windows.h"
#ifndef ASSERT
#define ASSERT(expr) _ASSERTE(expr)
#endif
#elif defined DUILIB_BUILD_FOR_LINUX
#include "duilib_config_linux.h"
#include <cassert>
#ifdef _DEBUG
#define ASSERT(expr) assert(expr)
#else
#define ASSERT(expr) ((void)(0))
#endif
#endif
//字符串类的定义
#include "duilib_string.h"
#endif //DUILIB_CONFIG_H_