Skip to content

Commit 22f4c27

Browse files
Kirill Smelkovgitster
authored andcommitted
mingw: activate alloca
Both MSVC and MINGW have alloca(3) definitions in malloc.h, so by moving win32-compat alloca.h from compat/vcbuild/include/ to compat/win32/ , which is included by both MSVC and MINGW CFLAGS, we can make alloca() work on both those Windows environments. In MINGW, malloc.h has explicit check for GNUC and if it is so, defines alloca to __builtin_alloca, so it looks like we don't need to add any code to here-shipped alloca.h to get optimum performance. Compile-tested on Windows in MSysGit. Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Acked-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7195fbf commit 22f4c27

File tree

2 files changed

+1
-0
lines changed

2 files changed

+1
-0
lines changed

config.mak.uname

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
480480
endif
481481
ifneq (,$(findstring MINGW,$(uname_S)))
482482
pathsep = ;
483+
HAVE_ALLOCA_H = YesPlease
483484
NO_PREAD = YesPlease
484485
NEEDS_CRYPTO_WITH_SSL = YesPlease
485486
NO_LIBGEN_H = YesPlease

0 commit comments

Comments
 (0)