export.h 1.2 KB

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