summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-12-01 21:24:59 +0100
committerJohannes Sixt <johannes.sixt@telecom.at>2008-06-22 11:32:45 +0200
commitf4626df51f63d53b89ff01de54cbf7558217ea2b (patch)
tree3f2e8f987cab6e12fcb8fa4d4a6004e60e57b053 /git-compat-util.h
parent58eda02257a89df6e05f504bdf87e578d90f3b5e (diff)
downloadgit-f4626df51f63d53b89ff01de54cbf7558217ea2b.tar.gz
Add target architecture MinGW.
With this change GIT can be compiled and linked using MinGW. Builtins that only read the repository such as the log family and grep already work. Simple stubs are provided for a number of functions that the Windows C runtime does not offer. They will be completed in later patches. However, a fix for the snprintf/vsnprintf replacement is applied here to avoid buffer overflows. Dmitry Kakurin pointed out that access(..., X_OK) would always fails on Vista and suggested the -D__USE_MINGW_ACCESS workaround. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index c04e8baa87..da7249ac1c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -63,17 +63,18 @@
#include <sys/time.h>
#include <time.h>
#include <signal.h>
-#include <sys/wait.h>
#include <fnmatch.h>
+#include <assert.h>
+#include <regex.h>
+#include <utime.h>
+#ifndef __MINGW32__
+#include <sys/wait.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <utime.h>
#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
#endif
-#include <assert.h>
-#include <regex.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
@@ -89,6 +90,10 @@
#include <grp.h>
#define _ALL_SOURCE 1
#endif
+#else /* __MINGW32__ */
+/* pull in Windows compatibility stuff */
+#include "compat/mingw.h"
+#endif /* __MINGW32__ */
#ifndef NO_ICONV
#include <iconv.h>