libnec.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _LIBNEC_H_
  2. #define _LIBNEC_H_
  3. /* 操作系统检测 | os identification
  4. NEC_WINDOWS : Windows
  5. NEC_MACOSX : Mac OS X
  6. NEC_LINUX : Linux
  7. NEC_FREEBSD : FreeBSD
  8. */
  9. /* 编译器检测 | compiler identification
  10. NEC_VISUAL_STUDIO : Microsoft Visual Studio
  11. NEC_MINGW32 : Mingw32
  12. NEC_GCC : gcc/g++
  13. */
  14. /* 字长 | word size
  15. NEC_64BITS : 64 bits OS
  16. NEC_WIN64 : 64 bits Windows
  17. NEC_WIN32 : 32 bits Windows
  18. NEC_LINUX64 : 64 bits Linux
  19. NEC_LINUX32 : 32 bits Linux
  20. NEC_FREEBSD64 : 64 bits FreeBSD
  21. NEC_FREEBSD32 : 32 bits FreeBSD
  22. */
  23. #if defined(_MSC_VER)
  24. #define NEC_VISUAL_STUDIO
  25. #define NEC_WINDOWS
  26. #ifdef _WIN64
  27. #define NEC_WIN64
  28. #define NEC_64BITS
  29. #else
  30. #define NEC_WIN32
  31. #endif
  32. #elif defined(__MINGW32__)
  33. #define NEC_WINDOWS
  34. #define NEC_MINGW32
  35. #define NEC_WIN32
  36. #elif defined(__linux)
  37. #define NEC_LINUX
  38. #define NEC_GCC
  39. #if __WORDSIZE==64
  40. #define NEC_LINUX64
  41. #define NEC_64BITS
  42. #else
  43. #define NEC_LINUX32
  44. #endif
  45. #elif defined(__FreeBSD__)
  46. #define NEC_FREEBSD
  47. #define NEC_GCC
  48. #if __WORDSIZE==64
  49. #define NEC_FREEBSD64
  50. #define NEC_64BITS
  51. #else
  52. #define NEC_FREEBSD32
  53. #endif
  54. #elif defined(__APPLE__) && defined(__MACH__)
  55. #define NEC_MACOSX
  56. #define NEC_GCC
  57. #endif
  58. /* This is a hack. SDL by default want you to rename your main statement, and insert it's own first
  59. It does that to handle some init code. However, libtcod handles that for you. If we did this
  60. wrappers like libtcod-net would be hosed, since there is no main statement there.
  61. */
  62. #ifdef NEC_MACOSX
  63. #define _SDL_main_h_
  64. #include "SDL/SDL.h"
  65. #endif
  66. #define NEC_HEX_VERSION 0x000001
  67. #define NEC_STR_VERSION "0.01"