From: Bruno Haible Date: Fri, 9 Jan 2026 22:51:43 +0000 (+0100) Subject: Support MSVC in packages that use GNU Autoconf. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F910%2Fhead;p=thirdparty%2Fjson-c.git 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. --- diff --git a/json_inttypes.h b/json_inttypes.h index a33a31f..4cc5fc1 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 e143b46..f81af88 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