Skip to content

Commit ef9c7cb

Browse files
authored
Merge pull request #3069 from xianglin1998/master
Fix compiler errors (MSYS2+UCRT)
2 parents 5a2462a + ab9f9eb commit ef9c7cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
3232
- Added `hf seos write` command (@aaronjamt)
3333
- Added `hf seos sim` command (@aaronjamt)
3434
- Fix `hf mf staticnested` faild to find a KeyB (@xianglin1998)
35+
- Fix errors(jansson) for MSYS2+UCRT compiler (@xianglin1998)
3536

3637
## [Phrack.4.20728][2025-09-11]
3738
- Added `unofficial desfire bible` document (@mistial-dev)

client/deps/jansson/jansson.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <stdio.h>
1212
#include <stdlib.h> /* for size_t */
1313
#include <stdarg.h>
14+
#include <inttypes.h>
1415

1516
#include "jansson_config.h"
1617

@@ -65,12 +66,10 @@ typedef struct json_t {
6566

6667
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
6768
#if JSON_INTEGER_IS_LONG_LONG
68-
#ifdef _WIN32
69-
#define JSON_INTEGER_FORMAT "I64d"
70-
#else
71-
#define JSON_INTEGER_FORMAT "lld"
72-
#endif
73-
typedef long long json_int_t;
69+
// Judging the ‘_WIN32 ’ macro in Msys2 environment will result in UCRT being unable to recognize I64d.
70+
// We may need to use inttypes.h & stdint.h for better compatibility.
71+
#define JSON_INTEGER_FORMAT PRId64
72+
typedef int64_t json_int_t;
7473
#else
7574
#define JSON_INTEGER_FORMAT "ld"
7675
typedef long json_int_t;

0 commit comments

Comments
 (0)