1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#ifndef cross_platform_h
#define cross_platform_h
#if defined(_WIN32)
// On Windows, the functions needs to explicitly be marked as import/export.
# define IMPORT __declspec(dllimport)
# define EXPORT __declspec(dllexport)
#elif defined(__APPLE__) || defined(__linux__) || defined(__unix__) || defined(_POSIX_VERSION)
// On Apple, Linux, UNIX or POSIX (using gcc) no such marking is required.
# define IMPORT
# define EXPORT
#else
# error "Unsupported operating system (neither UNIX nor Windows)."
#endif
#ifdef BUILD
# define INTERFACE EXPORT
#else
# define INTERFACE IMPORT
#endif
#endif
|