src/cx/common.h

changeset 1018
c773da859bad
parent 1016
fe177d6dabb8
--- a/src/cx/common.h	Sun Dec 15 15:23:29 2024 +0100
+++ b/src/cx/common.h	Sun Dec 15 15:41:18 2024 +0100
@@ -99,6 +99,18 @@
 #include <sys/types.h>
 
 // ---------------------------------------------------------------------------
+//       Architecture Detection
+// ---------------------------------------------------------------------------
+
+#if INTPTR_MAX == INT64_MAX
+#define CX_WORDSIZE 64
+#elif INTPTR_MAX == INT32_MAX
+#define CX_WORDSIZE 32
+#else
+#error Unknown pointer size or missing size macros!
+#endif
+
+// ---------------------------------------------------------------------------
 //       Attribute definitions
 // ---------------------------------------------------------------------------
 

mercurial