Strings_Defs.h 823 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef STRINGS_DEFS_HEADER
  2. #define STRINGS_DEFS_HEADER
  3. #include "../../../JSONOptions.h"
  4. #ifdef JSON_UNICODE
  5. #define json_char wchar_t
  6. #define json_uchar wchar_t
  7. #ifdef __cplusplus
  8. #include <cwchar> /* need wide characters */
  9. #ifndef JSON_STRING_HEADER
  10. #include <string>
  11. #endif
  12. #else
  13. #include <wchar.h> /* need wide characters */
  14. #endif
  15. #define JSON_TEXT(s) L ## s
  16. #define json_strlen wcslen
  17. #define json_strcmp wcscmp
  18. #else
  19. #define json_char char
  20. #define json_uchar unsigned char
  21. #ifdef __cplusplus
  22. #ifndef JSON_STRING_HEADER
  23. #include <string>
  24. #endif
  25. #else
  26. #include <string.h> /* still need it for strlen and such */
  27. #endif
  28. #define JSON_TEXT(s) s
  29. #define json_strlen strlen
  30. #define json_strcmp strcmp
  31. #endif
  32. #endif