Banuba SDK
Loading...
Searching...
No Matches
defs.hpp
1#pragma once
2
3/**
4 * @addtogroup Utils
5 * @{
6 */
7
8#ifdef BNB_EXPORT
9 // fix warning about macro redefinition, BNB_EXPORT is also defined in wraps/c_api_common/include/interfaces/bnb/export.h
10 #undef BNB_EXPORT
11#endif
12
13#ifdef _WIN32
14 #if BNB_SDK_SHARED_LIBRARY
15 #define BNB_EXPORT __declspec(dllexport)
16 #elif BNB_SDK_STATIC_LIBRARY
17 #define BNB_EXPORT
18 #else
19 #define BNB_EXPORT __declspec(dllimport)
20 #endif
21#else
22 #define BNB_EXPORT __attribute__((__visibility__("default")))
23#endif
24
25//-----------------------
26
27#define BNB_OS_ANDROID 0
28
29#if !defined(BNB_DETAIL_OS_DETECTED) && (defined(__ANDROID__))
30 #undef BNB_OS_ANDROID
31 #define BNB_OS_ANDROID 1
32#endif
33
34#if BNB_OS_ANDROID
35 #define BNB_OS_ANDROID_AVAILABLE
36 #include <bnb/utils/os_detected.hpp>
37#endif
38
39//-----------------------
40
41#define BNB_OS_IOS 0
42
43#if !defined(BNB_DETAIL_OS_DETECTED) && (defined(__APPLE__) && defined(__MACH__) && defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__))
44 #undef BNB_OS_IOS
45 #define BNB_OS_IOS 1
46#endif
47
48#if BNB_OS_IOS
49 #define BNB_OS_IOS_AVAILABLE
50 #include <bnb/utils/os_detected.hpp>
51#endif
52
53//-----------------------
54
55#define BNB_OS_LINUX 0
56
57#if !defined(BNB_DETAIL_OS_DETECTED) && (defined(linux) || defined(__linux))
58 #undef BNB_OS_LINUX
59 #define BNB_OS_LINUX 1
60#endif
61
62#if BNB_OS_LINUX
63 #define BNB_OS_LINUX_AVAILABLE
64 #include <bnb/utils/os_detected.hpp>
65#endif
66
67//-----------------------
68
69#define BNB_OS_MACOS 0
70
71#if !defined(BNB_DETAIL_OS_DETECTED) && (defined(macintosh) || defined(Macintosh) || (defined(__APPLE__) && defined(__MACH__)))
72 #undef BNB_OS_MACOS
73 #define BNB_OS_MACOS 1
74#endif
75
76#if BNB_OS_MACOS
77 #define BNB_OS_MACOS_AVAILABLE
78 #include <bnb/utils/os_detected.hpp>
79#endif
80
81//-----------------------
82
83#define BNB_OS_EMSCRIPTEN 0
84
85#if !defined(BNB_DETAIL_OS_DETECTED) && defined(__EMSCRIPTEN__)
86 #undef BNB_OS_EMSCRIPTEN
87 #define BNB_OS_EMSCRIPTEN 1
88#endif
89
90#if BNB_OS_EMSCRIPTEN
91 #define BNB_OS_EMSCRIPTEN_AVAILABLE
92 #include <bnb/utils/os_detected.hpp>
93#endif
94
95//-----------------------
96
97#define BNB_OS_UNIX 0
98
99#if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
100 #undef BNB_OS_UNIX
101 #define BNB_OS_UNIX 1
102#endif
103
104#if BNB_OS_UNIX
105 #define BNB_OS_UNIX_AVAILABLE
106#endif
107
108//-----------------------
109
110#define BNB_OS_WINDOWS 0
111#define BNB_OS_WINDOWS_ARM64 0
112
113#if !defined(BNB_DETAIL_OS_DETECTED) && (defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__))
114 #undef BNB_OS_WINDOWS
115 #define BNB_OS_WINDOWS 1
116 #undef BNB_OS_WINDOWS_ARM64
117 #define BNB_OS_WINDOWS_ARM64 _M_ARM64
118#endif
119
120#if BNB_OS_WINDOWS
121 #define BNB_OS_WINDOWS_AVAILABLE
122 #include <bnb/utils/os_detected.hpp>
123#endif
124
125
126#define BNB_APPLE 0
127
128#if defined(macintosh) || defined(Macintosh) || defined(__APPLE__)
129 #undef BNB_APPLE
130 #define BNB_APPLE 1
131#endif
132
133//-----------------------
134
135#if BNB_OS_ANDROID || BNB_OS_IOS || BNB_OS_EMSCRIPTEN
136 #define BNB_GLSL_VERSION "#version 300 es\n"
137#elif BNB_OS_WINDOWS || BNB_OS_MACOS || BNB_OS_UNIX
138 #define BNB_GLSL_VERSION "#version 410 core\n"
139#else
140 #error "Can't determine GLSL version for OS"
141#endif
142
143#if !defined(__cpp_char8_t)
144typedef char char8_t;
145#endif
146
147/** @} */ // endgroup utils