您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

110 行
2.1 KiB

  1. #pragma once
  2. #if TARGET_OS_IOS == 1
  3. #define OS_IOS 1
  4. #endif
  5. #ifdef WIN32
  6. #ifdef XJSON_EXPORTS
  7. #define XJSON_API __declspec(dllexport)
  8. #define XJSON_TEMPLATE __declspec(dllexport)
  9. #else
  10. #define XJSON_API __declspec(dllimport)
  11. #define XJSON_TEMPLATE
  12. #endif
  13. #define CALLBACK __stdcall
  14. #else
  15. #define XJSON_API
  16. #define CALLBACK
  17. #endif
  18. #if (defined(WIN32)||defined(_WIN32) ||defined(__WIN32__)||defined(__NT__))
  19. #define OS_WIN32
  20. #else
  21. #define OS_LINUX
  22. //#define OS_IOS
  23. #endif
  24. #if defined(_MSC_VER)
  25. #define CC_MSVC
  26. #endif
  27. #ifdef OS_WIN32
  28. //#define _WIN32_WINNT 0x0400
  29. #define WIN32_LEAN_AND_MEAN
  30. #include <windows.h>
  31. #undef WIN32_LEAN_AND_MEAN
  32. #else
  33. #include <unistd.h>
  34. #include <time.h>
  35. #include <sys/time.h>
  36. #include <errno.h>
  37. #include <pthread.h>
  38. #endif
  39. // 一般库建议都加上命名空间,以防冲突
  40. // 命名空间快速定义 开始与结束
  41. #define NS_XJSON_BEGIN namespace XJSON_LIB {
  42. #define NS_XJSON_END_AND_USE }using namespace XJSON_LIB;
  43. #define NS_BEGIN(Name) namespace Name {
  44. #define NS_END_AND_USE(Name) }using namespace Name;
  45. #define NS_END }
  46. #pragma warning(disable: 4251)
  47. #pragma warning(disable: 4244)
  48. #pragma warning(disable: 4275)
  49. #pragma warning(disable: 4514)
  50. #pragma warning(disable: 4800)
  51. #pragma warning(disable: 4097)
  52. #pragma warning(disable: 4706)
  53. #pragma warning(disable: 4786)
  54. #pragma warning(disable: 4660)
  55. #pragma warning(disable: 4355)
  56. #pragma warning(disable: 4231)
  57. #pragma warning(disable: 4710)
  58. #pragma warning(disable: 4530)
  59. #pragma warning(disable: 4996)
  60. #ifndef uint64
  61. #if defined( WIN32 )
  62. typedef unsigned __int64 uint64;
  63. #define FORMAT_INT64 "%I64d"
  64. #else
  65. typedef unsigned long long uint64;
  66. #define FORMAT_INT64 "%lld"
  67. #endif
  68. #endif
  69. #ifndef int64
  70. #ifdef WIN32
  71. typedef __int64 int64;
  72. #else
  73. typedef long long int64;
  74. #endif
  75. #endif
  76. #ifndef Bool
  77. #define Bool int
  78. #endif
  79. #ifndef TRUE
  80. #define TRUE 1
  81. #endif
  82. #ifndef FALSE
  83. #define FALSE 0
  84. #endif
  85. #ifndef NULL
  86. #define NULL 0
  87. #endif
  88. #ifndef uchar
  89. typedef unsigned char uchar;
  90. #endif
  91. #ifndef uint
  92. typedef unsigned int uint;
  93. #endif