-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHost.h
79 lines (67 loc) · 1.15 KB
/
Host.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
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
/**
* Operating System
*/
#if defined(WIN32) || defined(_WIN32)
#define OS_MSWINDOWS 1
#elif defined(__linux__)
#define OS_LINUX 1
#endif
#ifndef OS_MSWINDOWS
#define OS_MSWINDOWS 0
#endif
#ifndef OS_LINUX
#define OS_LINUX 0
#endif
/**
* Host Compiler
*/
#if defined(__clang__)
#define COMPILER_CLANG 1
#elif defined(_MSC_VER) || defined(_MSC_FULL_VER)
#define COMPILER_MSVC 1
#elif defined(__GNUC__) || defined(__GNUG__)
#define COMPILER_GCC 1
#endif
#ifndef COMPILER_MSVC
#define COMPILER_MSVC 0
#endif
#ifndef COMPILER_CLANG
#define COMPILER_CLANG 0
#endif
#ifndef COMPILER_GCC
#define COMPILER_GCC 0
#endif
#if COMPILER_MSVC
#ifdef MAKE_DLL
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif
#endif
/**
* Inline
*/
#if COMPILER_MSVC
#define _inline __forceinline
#elif COMPILER_GCC || COMPILER_CLANG
#define _inline inline
#else
#error "Unsupported compiler type for _inline!"
#endif
/**
* Restrict
*/
#if COMPILER_MSVC
#define _restrict __declspec(restrict)
#else
#define _restrict
#endif
/**
* Allocator
*/
#if COMPILER_MSVC
#define _allocator __declspec(allocator)
#else
#define _allocator
#endif