export.h 1.1 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. #include <emscripten.h>
  8. #define PK_EXPORT EMSCRIPTEN_KEEPALIVE
  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