Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2009-02-18 21:53:48 +0300
committerShawn O. Pearce <spearce@spearce.org>2009-03-18 05:00:08 +0300
commit840fb8b7cb13069c2c5f691beb30c8039b384526 (patch)
tree9bffded46b22351f3c12eb5c020ae005e57cbc90 /src/common.h
parenta9984a4e60291958a7cf0045758f47db3d214040 (diff)
win32: fixup some headers to improve win32 compilation
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/common.h b/src/common.h
index 798d19706..14dc301e7 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,6 +1,10 @@
#ifndef INCLUDE_common_h__
#define INCLUDE_common_h__
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#define GIT_WIN32 1
+#endif
+
#include "git/thread-utils.h"
#ifdef GIT_HAS_PTHREAD
@@ -11,9 +15,26 @@
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
-#include <unistd.h>
+#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
+
+#ifdef GIT_WIN32
+
+# include <io.h>
+# include <winsock2.h>
+
+typedef int ssize_t;
+
+#else
+
+# include <unistd.h>
+# include <sys/mman.h>
+# include <arpa/inet.h>
+
+#endif
+
#include "cc-compat.h"
#include "git/common.h"
#include "util.h"