Skip to content

Commit 874c21b

Browse files
committed
fixup! mingw: allow git.exe to be used instead of the "Git wrapper"
This patch makes it so that Git really sets the desired `MSYSTEM` on Windows/ARM64. The reason this did not work (and my faulty tests did not catch that before merging #5586) is that clang (at least version 20.1.3 as built from https://github.com/git-for-windows/MINGW-packages 8df0c2fff4184deff15acce9bfd791fb6e0d60fe) predefines the `__MINGW64__` constant: $ echo | clang -dM -E - | grep -n MINGW64 249:#define __MINGW64__ 1 Let's just switch the order between the CLANGARM64 and the MINGW64 test; This will still work for MINGW64 because none of the constants used in the CLANGARM64 condition are defined for x64 gcc (or for that matter, clang). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent eaeb5b5 commit 874c21b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compat/mingw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,10 +3722,10 @@ static void setup_windows_environment(void)
37223722
char buf[32768];
37233723
size_t off = 0;
37243724

3725-
#if defined(__MINGW64__) || defined(_M_AMD64)
3726-
setenv("MSYSTEM", "MINGW64", 1);
3727-
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
3725+
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
37283726
setenv("MSYSTEM", "CLANGARM64", 1);
3727+
#elif defined(__MINGW64__) || defined(_M_AMD64)
3728+
setenv("MSYSTEM", "MINGW64", 1);
37293729
#else
37303730
setenv("MSYSTEM", "MINGW32", 1);
37313731
#endif

0 commit comments

Comments
 (0)