Fix compiler errors (MSYS2+UCRT)

This commit is contained in:
dxl
2025-12-26 10:50:22 +08:00
parent 5a2462aed4
commit ed303e8246
+4 -5
View File
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h> /* for size_t */
#include <stdarg.h>
#include <inttypes.h>
#include "jansson_config.h"
@@ -65,11 +66,9 @@ typedef struct json_t {
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
#if JSON_INTEGER_IS_LONG_LONG
#ifdef _WIN32
#define JSON_INTEGER_FORMAT "I64d"
#else
#define JSON_INTEGER_FORMAT "lld"
#endif
// Judging the _WIN32 macro in Msys2 environment will result in UCRT being unable to recognize I64d.
// We may need to use inttypes.h for better compatibility.
#define JSON_INTEGER_FORMAT PRId64
typedef long long json_int_t;
#else
#define JSON_INTEGER_FORMAT "ld"