Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MJPA/SimpleJSON.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMJPA <git@mjpa.co.uk>2010-09-23 01:18:58 +0400
committerMJPA <git@mjpa.co.uk>2010-09-23 01:18:58 +0400
commit45febdedae6b44ce3fb252bcb730ab0e5eb70179 (patch)
tree9f58632727e82b78d5f15e56a71cf30a2981949b /src
parent3e083a308597d0d9f0701385ae86efd60b9ef511 (diff)
Mac compile fixes
Diffstat (limited to 'src')
-rw-r--r--src/JSON.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/JSON.h b/src/JSON.h
index da342bd..341f7c7 100644
--- a/src/JSON.h
+++ b/src/JSON.h
@@ -41,6 +41,24 @@
#include <cstdlib>
#endif
+// Mac compile fixes - from quaker66
+#if defined(__APPLE__)
+ #include <wctype.h>
+ #include <wchar.h>
+ #include <algorithm>
+
+ static inline int wcsncasecmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+ {
+ if (!wcsncmp(s1, s2, n))
+ return 0;
+
+ std::wstring ws(s1), wws(s2);
+ transform(ws.begin(), ws.end(), ws.begin(), towlower);
+ transform(wws.begin(), wws.end(), wws.begin(), towlower);
+ return wcsncmp(ws.c_str(), wws.c_str(), n);
+ }
+#endif
+
// Custom types
class JSONValue;
typedef std::vector<JSONValue*> JSONArray;