Skip to content

Commit c4d8c97

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
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 19c81c7 commit c4d8c97

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
@@ -3746,10 +3746,10 @@ static void setup_windows_environment(void)
37463746
char buf[32768];
37473747
size_t off = 0;
37483748

3749-
#if defined(__MINGW64__) || defined(_M_AMD64)
3750-
setenv("MSYSTEM", "MINGW64", 1);
3751-
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
3749+
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
37523750
setenv("MSYSTEM", "CLANGARM64", 1);
3751+
#elif defined(__MINGW64__) || defined(_M_AMD64)
3752+
setenv("MSYSTEM", "MINGW64", 1);
37533753
#else
37543754
setenv("MSYSTEM", "MINGW32", 1);
37553755
#endif

0 commit comments

Comments
 (0)