nCine 2025.12.r529-30f7d03
A cross-platform 2D game engine
Loading...
Searching...
No Matches
common_defines.h
1#ifndef NCINE_COMMON_DEFINES
2#define NCINE_COMMON_DEFINES
3
4#ifndef NCINE_STATIC
5 #if defined(_WIN32) || defined(__CYGWIN__)
6 #ifdef ncine_EXPORTS // automatically defined by CMake
7 #if defined(__GNUC__) || defined(__llvm__)
8 #define DLL_PUBLIC __attribute__((dllexport))
9 #else
10 #define DLL_PUBLIC __declspec(dllexport)
11 #endif
12 #else
13 #if defined(__GNUC__) || defined(__llvm__)
14 #define DLL_PUBLIC __attribute__((dllimport))
15 #else
16 #define DLL_PUBLIC __declspec(dllimport)
17 #endif
18 #endif
19 #define DLL_LOCAL
20 #else
21 #if __GNUC__ >= 4 || defined(__llvm__)
22 #define DLL_PUBLIC __attribute__((visibility("default")))
23 #define DLL_LOCAL __attribute__((visibility("hidden")))
24 #else
25 #define DLL_PUBLIC
26 #define DLL_LOCAL
27 #endif
28 #endif
29#else
30 #define DLL_PUBLIC
31 #define DLL_LOCAL
32#endif
33
34#if defined(__has_cpp_attribute)
35 #if __has_cpp_attribute(nodiscard)
36 #define NODISCARD [[nodiscard]]
37 #else
38 #define NODISCARD
39 #endif
40#else
41 #define NODISCARD
42#endif
43
44#endif