Unravel Engine C++ Reference
Loading...
Searching...
No Matches
export.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "config.hpp"
4
6// Define helpers to create portable import / export macros for each module
8#if !defined(UNRAVEL_STATIC)
9
10#if UNRAVEL_PLATFORM_WINDOWS
11// Windows compilers need specific (and different) keywords for export and import
12#define UNRAVEL_API_EXPORT __declspec(dllexport)
13#define UNRAVEL_API_IMPORT __declspec(dllimport)
14
15// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
16#if UNRAVEL_COMPILER_MSVC
17#pragma warning(disable : 4251)
18#endif
19
20#else // Linux, FreeBSD, Mac OS X
21
22// GCC 4+ has special keywords for showing/hidding symbols,
23// the same keyword is used for both importing and exporting
24#define UNRAVEL_API_EXPORT __attribute__((__visibility__("default")))
25#define UNRAVEL_API_IMPORT __attribute__((__visibility__("default")))
26
27#endif
28
29#else
30
31// Static build doesn't need import/export macros
32#define UNRAVEL_API_EXPORT
33#define UNRAVEL_API_IMPORT
34
35#endif
36
38// Define portable import / export macros
40#if defined(UNRAVEL_API_EXPORTS)
41#define UNRAVEL_API UNRAVEL_API_EXPORT
42#else
43#define UNRAVEL_API UNRAVEL_API_IMPORT
44#endif