Skip to content

Commit f2d50d9

Browse files
Ramsay Jonesgitster
authored andcommitted
Fix MSVC build on cygwin
In the MSVC section of the Makefile, BASIC_CFLAGS is set to a value which contains the string "-DWIN32-D_CONSOLE". This results in a (single) malformed -Define being passed to the compiler. At least on my cygwin installation, the msvc compiler seems to ignore this parameter, without issuing an error or warning, and results in the WIN32 and _CONSOLE macros being undefined. This breaks the build. In order to fix the build, we simply insert a space between the two -Define parameters, "-DWIN32" and "-D_CONSOLE", as originally intended. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5c3178 commit f2d50d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ ifdef MSVC
914914
CC = compat/vcbuild/scripts/clink.pl
915915
AR = compat/vcbuild/scripts/lib.pl
916916
CFLAGS =
917-
BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32-D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
917+
BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
918918
COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o
919919
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -DSTRIP_EXTENSION=\".exe\"
920920
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib

0 commit comments

Comments
 (0)