export.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
  3. //define something for Windows (32-bit and 64-bit, this part is common)
  4. #define PK_EXPORT __declspec(dllexport)
  5. #define PK_SYS_PLATFORM 0
  6. #elif __EMSCRIPTEN__
  7. #define PK_EXPORT
  8. #define PK_SYS_PLATFORM 1
  9. #elif __APPLE__
  10. #include <TargetConditionals.h>
  11. #if TARGET_IPHONE_SIMULATOR
  12. // iOS, tvOS, or watchOS Simulator
  13. #define PK_SYS_PLATFORM 2
  14. #elif TARGET_OS_IPHONE
  15. // iOS, tvOS, or watchOS device
  16. #define PK_SYS_PLATFORM 2
  17. #elif TARGET_OS_MAC
  18. #define PK_SYS_PLATFORM 3
  19. #else
  20. # error "Unknown Apple platform"
  21. #endif
  22. #define PK_EXPORT __attribute__((visibility("default")))
  23. #elif __ANDROID__
  24. #define PK_EXPORT __attribute__((visibility("default")))
  25. #define PK_SYS_PLATFORM 4
  26. #elif __linux__
  27. #define PK_EXPORT __attribute__((visibility("default")))
  28. #define PK_SYS_PLATFORM 5
  29. #else
  30. #define PK_EXPORT
  31. #define PK_SYS_PLATFORM 6
  32. #endif