Commit 840fb8b7 by Ramsay Jones Committed by Shawn O. Pearce

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>
parent a9984a4e
#ifndef INCLUDE_common_h__ #ifndef INCLUDE_common_h__
#define INCLUDE_common_h__ #define INCLUDE_common_h__
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
#define GIT_WIN32 1
#endif
#include "git/thread-utils.h" #include "git/thread-utils.h"
#ifdef GIT_HAS_PTHREAD #ifdef GIT_HAS_PTHREAD
...@@ -11,9 +15,26 @@ ...@@ -11,9 +15,26 @@
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <stdio.h>
#include <string.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 "cc-compat.h"
#include "git/common.h" #include "git/common.h"
#include "util.h" #include "util.h"
......
#include "common.h" #include "common.h"
#include "fileops.h" #include "fileops.h"
#include <sys/mman.h>
int gitfo_open(const char *path, int flags) int gitfo_open(const char *path, int flags)
{ {
......
...@@ -10,14 +10,9 @@ ...@@ -10,14 +10,9 @@
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
#include "common.h" #include "common.h"
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h>
#include <time.h> #include <time.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h> #include <dirent.h>
#define GITFO_BUF_INIT {NULL, 0} #define GITFO_BUF_INIT {NULL, 0}
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "git/zlib.h" #include "git/zlib.h"
#include "fileops.h" #include "fileops.h"
#include "hash.h" #include "hash.h"
#include <arpa/inet.h>
#include <stdio.h>
#include "odb.h" #include "odb.h"
#define GIT_PACK_NAME_MAX (5 + 40 + 1) #define GIT_PACK_NAME_MAX (5 + 40 + 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment