src/cx/common.h

changeset 1076
bb4da3255de3
parent 1053
2e86cf779135
child 1093
bcbf6bf582fa
--- a/src/cx/common.h	Wed Jan 01 15:56:02 2025 +0100
+++ b/src/cx/common.h	Wed Jan 01 16:06:32 2025 +0100
@@ -117,6 +117,19 @@
 #endif
 
 // ---------------------------------------------------------------------------
+//       Missing Defines
+// ---------------------------------------------------------------------------
+
+#ifndef SSIZE_MAX // not defined in glibc since C23 and MSVC
+#if CX_WORDSIZE == 64
+#define SSIZE_MAX 0x7fffffffffffffffll
+#else
+#define SSIZE_MAX 0x7fffffffl
+#endif
+#endif
+
+
+// ---------------------------------------------------------------------------
 //       Attribute definitions
 // ---------------------------------------------------------------------------
 
@@ -365,13 +378,6 @@
 // fix missing ssize_t definition
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;
-#ifndef SSIZE_MAX
-#ifdef _WIN64
-#define SSIZE_MAX 0x7fffffffffffffffi64
-#else
-#define SSIZE_MAX 0x7fffffffi32
-#endif
-#endif
 
 // fix missing _Thread_local support
 #define _Thread_local __declspec(thread)

mercurial