]> granicus.if.org Git - libexpat/commitdiff
Add wrapper macro to give string literals the right type for XML_Char*
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 4 Aug 2017 17:14:30 +0000 (18:14 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 20:30:32 +0000 (22:30 +0200)
expat/tests/runtests.c

index 90b27192abdcfb202d91dba439f125af790ae491..06c1ed20022343410a633caf35c29327e44adc58 100644 (file)
@@ -76,6 +76,8 @@
 #define xcstrlen(s) wcslen(s)
 #define xcstrcmp(s, t) wcscmp((s), (t))
 #define xcstrncmp(s, t, n) wcsncmp((s), (t), (n))
+#define XCS(s) _XCS(s)
+#define _XCS(s) L ## s
 #else
 #ifdef XML_UNICODE
 #error "No support for UTF-16 character without wchar_t in tests"
@@ -85,6 +87,7 @@
 #define xcstrlen(s) strlen(s)
 #define xcstrcmp(s, t) strcmp((s), (t))
 #define xcstrncmp(s, t, n) strncmp((s), (t), (n))
+#define XCS(s) s
 #endif /* XML_UNICODE */
 #endif /* XML_UNICODE_WCHAR_T */