From 9774826e79d06f69b2e5c1d679b01b4304227f4a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 9 Jan 2026 23:51:43 +0100 Subject: [PATCH] Support MSVC in packages that use GNU Autoconf. 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 | 2 +- json_object_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json_inttypes.h b/json_inttypes.h index a33a31f1..4cc5fc19 100644 --- a/json_inttypes.h +++ b/json_inttypes.h @@ -29,7 +29,7 @@ typedef unsigned __int64 uint64_t; #endif -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(ssize_t) #include typedef SSIZE_T ssize_t; #endif diff --git a/json_object_private.h b/json_object_private.h index e143b464..f81af881 100644 --- a/json_object_private.h +++ b/json_object_private.h @@ -28,7 +28,7 @@ struct json_object; #include #endif /* HAVE_UNISTD_H */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(ssize_t) #include typedef SSIZE_T ssize_t; #endif -- 2.47.3