From ed303e8246311d764fe4ae2a8593077b26bd7e66 Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Fri, 26 Dec 2025 10:50:22 +0800 Subject: [PATCH 1/3] Fix compiler errors (MSYS2+UCRT) --- client/deps/jansson/jansson.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/deps/jansson/jansson.h b/client/deps/jansson/jansson.h index 75cbb5d51..74a3fddec 100644 --- a/client/deps/jansson/jansson.h +++ b/client/deps/jansson/jansson.h @@ -11,6 +11,7 @@ #include #include /* for size_t */ #include +#include #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" From 8be8d7b2f9eb35ab4330fb75b67acb1dc7a02d9b Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Fri, 26 Dec 2025 11:01:58 +0800 Subject: [PATCH 2/3] Changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd179445c..49c30523c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added `hf seos write` command (@aaronjamt) - Added `hf seos sim` command (@aaronjamt) - Fix `hf mf staticnested` faild to find a KeyB (@xianglin1998) +- Fix errors(jansson) for MSYS2+UCRT compiler (@xianglin1998) ## [Phrack.4.20728][2025-09-11] - Added `unofficial desfire bible` document (@mistial-dev) From ab9f9ebe279a534d92743a05244972fa160fd87c Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Fri, 26 Dec 2025 11:27:52 +0800 Subject: [PATCH 3/3] Define json_int_t as type int64_t when JSON_INTEGER_IS_LONG_LONG is enabled. --- client/deps/jansson/jansson.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/deps/jansson/jansson.h b/client/deps/jansson/jansson.h index 74a3fddec..161c794a7 100644 --- a/client/deps/jansson/jansson.h +++ b/client/deps/jansson/jansson.h @@ -67,9 +67,9 @@ typedef struct json_t { #ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ #if JSON_INTEGER_IS_LONG_LONG // 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. +// We may need to use inttypes.h & stdint.h for better compatibility. #define JSON_INTEGER_FORMAT PRId64 -typedef long long json_int_t; +typedef int64_t json_int_t; #else #define JSON_INTEGER_FORMAT "ld" typedef long json_int_t;