summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2010-11-23 19:38:29 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-23 16:06:50 -0800
commitd1b6e6e015501272c7491b3a4adf3cd3904edefa (patch)
treeb93cb52156b48591fe6ea5d873528cc9186f8c09 /Makefile
parente7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad (diff)
downloadgit-d1b6e6e015501272c7491b3a4adf3cd3904edefa.tar.gz
win32: use our own dirent.h
The mingw-runtime implemenation of opendir, readdir and closedir sets errno to 0 on success, something that POSIX explicitly forbids. 3ba7a06 ("A loose object is not corrupt if it cannot be read due to EMFILE") introduce a dependency on this behaviour, leading to a broken "git clone" on Windows. compat/mingw.c contains an implementation of readdir, and compat/msvc.c contains implementations of opendir and closedir. Move these to compat/win32/dirent.[ch], and change to our own DIR structure at the same time. This provides a generic Win32-implementation of opendir, readdir and closedir which works on both MinGW and MSVC and does not reset errno, and as a result git clone is working again on Windows. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 53986b1ecb..5bc9b19c57 100644
--- a/Makefile
+++ b/Makefile
@@ -499,6 +499,7 @@ LIB_H += compat/mingw.h
LIB_H += compat/win32/pthread.h
LIB_H += compat/win32/syslog.h
LIB_H += compat/win32/sys/poll.h
+LIB_H += compat/win32/dirent.h
LIB_H += csum-file.h
LIB_H += decorate.h
LIB_H += delta.h
@@ -1084,7 +1085,9 @@ ifeq ($(uname_S),Windows)
AR = compat/vcbuild/scripts/lib.pl
CFLAGS =
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
- COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o compat/win32/pthread.o compat/win32/syslog.o compat/win32/sys/poll.o
+ COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o \
+ compat/win32/pthread.o compat/win32/syslog.o \
+ compat/win32/sys/poll.o compat/win32/dirent.o
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
EXTLIBS = advapi32.lib shell32.lib wininet.lib ws2_32.lib
@@ -1137,7 +1140,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
- compat/win32/sys/poll.o
+ compat/win32/sys/poll.o compat/win32/dirent.o
EXTLIBS += -lws2_32
PTHREAD_LIBS =
X = .exe