Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. // define supported target platform macro which CC uses.
  2. #define CC_PLATFORM_UNKNOWN 0
  3. #define CC_PLATFORM_IOS 1
  4. #define CC_PLATFORM_ANDROID 2
  5. #define CC_PLATFORM_WIN32 3
  6. #define CC_PLATFORM_MARMALADE 4
  7. #define CC_PLATFORM_LINUX 5
  8. #define CC_PLATFORM_BADA 6
  9. #define CC_PLATFORM_QNX 7
  10.  
  11. // Determine tartet platform by compile environment macro.
  12. #define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
  13.  
  14. // iphone
  15. #if ! CC_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
  16. #undef CC_TARGET_PLATFORM
  17. #define CC_TARGET_PLATFORM CC_PLATFORM_IOS
  18. #define CC_SUPPORT_PVRTC
  19. #endif
  20.  
  21. // android
  22. #if ! CC_TARGET_PLATFORM && defined(ANDROID)
  23. #undef CC_TARGET_PLATFORM
  24. #define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID
  25. #endif
  26.  
  27. // win32
  28. #if ! CC_TARGET_PLATFORM && (defined(WIN32) && defined(_WINDOWS))
  29. #undef CC_TARGET_PLATFORM
  30. #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32
  31. #endif
  32.  
  33. // linux
  34. #if ! CC_TARGET_PLATFORM && defined(LINUX)
  35. #undef CC_TARGET_PLATFORM
  36. #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX
  37. #endif
  38.  
  39. // marmalade
  40. #if ! CC_TARGET_PLATFORM && defined(MARMALADE)
  41. #undef CC_TARGET_PLATFORM
  42. #define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE
  43. #endif
  44.  
  45. // bada
  46. #if ! CC_TARGET_PLATFORM && defined(SHP)
  47. #undef CC_TARGET_PLATFORM
  48. #define CC_TARGET_PLATFORM CC_PLATFORM_BADA
  49. #endif
  50.  
  51. // qnx
  52. #if ! CC_TARGET_PLATFORM && defined(__QNX__)
  53. #undef CC_TARGET_PLATFORM
  54. #define CC_TARGET_PLATFORM CC_PLATFORM_QNX
  55. #endif
  56.  
  57. //////////////////////////////////////////////////////////////////////////
  58. // post configure
  59. //////////////////////////////////////////////////////////////////////////
  60.  
  61. // check user set platform
  62. #if ! CC_TARGET_PLATFORM
  63. #error "Can not recognize the target platform, compling under a unsupported platform?"
  64. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement