aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-11 11:24:40 +0200
committerMartin Ridgers <[email protected]>2021-10-11 11:24:40 +0200
commit7b746d47d3d88a38e10957aaa4c6a526b8ce197e (patch)
tree4af3eff04c6b609dee9e05c310377c4dd24e63d2
parentMerged main (diff)
downloadzen-7b746d47d3d88a38e10957aaa4c6a526b8ce197e.tar.xz
zen-7b746d47d3d88a38e10957aaa4c6a526b8ce197e.zip
Added a ZEN_SIZEOF_WCHAR_T define
-rw-r--r--zencore/include/zencore/zencore.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h
index 136ed2944..3d8f3f1e3 100644
--- a/zencore/include/zencore/zencore.h
+++ b/zencore/include/zencore/zencore.h
@@ -94,6 +94,13 @@
#define ZEN_PLATFORM_SUPPORTS_UNALIGNED_LOADS 1
+#if defined(__SIZEOF_WCHAR_T__) && __SIZEOF_WCHAR_T__ == 4
+# define ZEN_SIZEOF_WCHAR_T 4
+#else
+ static_assert(sizeof(wchar_t) == 2, "wchar_t is expected to be two bytes in size");
+# define ZEN_SIZEOF_WCHAR_T 2
+#endif
+
//////////////////////////////////////////////////////////////////////////
// Assert
//