# HG changeset patch # User Mike Becker # Date 1735743992 -3600 # Node ID bb4da3255de352b5784b216f8342932e9158c7a6 # Parent 0cc4b63a0ae01bd5b666f6892aca8bcb014aaa59 fix missing SSIZE_T not only for MSVC diff -r 0cc4b63a0ae0 -r bb4da3255de3 src/cx/common.h --- 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 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)