]> git.ipfire.org Git - thirdparty/git.git/commitdiff
clar: avoid compile error with mingw-w64
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 4 Sep 2024 14:16:54 +0000 (16:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2024 15:41:36 +0000 (08:41 -0700)
When using mingw-w64 to compile the code, and using `_stat()`, it is
necessary to use `struct _stat`, too, and not `struct stat` (as the
latter is incompatible with the "dashed" version because it is limited
to 32-bit time types for backwards compatibility).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/clar/clar.c

index 3fc2c768158a69ff2bfa29ac2b0d386357df26c5..e2ebe551d3822f56e8ceb6fb9abdfaa98d4ef7e4 100644 (file)
@@ -68,7 +68,7 @@
 #              define PRIxZ "Ix"
 #      endif
 
-#      if defined(_MSC_VER) || defined(__MINGW32__)
+#      if defined(_MSC_VER) || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR))
        typedef struct stat STAT_T;
 #      else
        typedef struct _stat STAT_T;