src/cx/common.h

changeset 1026
ca20f9ffcb62
parent 1018
c773da859bad
--- a/src/cx/common.h	Wed Dec 18 15:36:45 2024 +0100
+++ b/src/cx/common.h	Wed Dec 18 15:40:13 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