]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Support MSVC in packages that use GNU Autoconf. 910/head
authorBruno Haible <bruno@clisp.org>
Fri, 9 Jan 2026 22:51:43 +0000 (23:51 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 9 Jan 2026 22:51:43 +0000 (23:51 +0100)
Fixes https://github.com/json-c/json-c/issues/909

When ssize_t is defined as a macro, typically through a package's config.h file,
the installed json*.h files must not attempt to define ssize_t via typedef.

json_inttypes.h
json_object_private.h

index a33a31f10725186d12c7db52383683c5b7f25135..4cc5fc19f2b781006727cca74847ca5a1fd40b46 100644 (file)
@@ -29,7 +29,7 @@ typedef unsigned __int64 uint64_t;
 
 #endif
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(ssize_t)
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;
 #endif
index e143b4649acdd8e8815aab0fbed5e36506c95a9d..f81af881f6a41dcaec1bc541e146b06f087d30c3 100644 (file)
@@ -28,7 +28,7 @@ struct json_object;
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(ssize_t)
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;
 #endif