]> git.proxmox.com Git - libgit2.git/blob - src/common.h
win32: Add separate MinGW and MSVC compatability header files
[libgit2.git] / src / common.h
1 #ifndef INCLUDE_common_h__
2 #define INCLUDE_common_h__
3
4 /** Force 64 bit off_t size on POSIX. */
5 #define _FILE_OFFSET_BITS 64
6
7 #if defined(_WIN32) && !defined(__CYGWIN__)
8 #define GIT_WIN32 1
9 #endif
10
11 #include "git/thread-utils.h"
12 #include "cc-compat.h"
13
14 #ifdef GIT_HAS_PTHREAD
15 # include <pthread.h>
16 #endif
17 #ifdef GIT_HAVE_INTTYPES_H
18 # include <inttypes.h>
19 #endif
20 #include <assert.h>
21 #include <errno.h>
22 #include <limits.h>
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <string.h>
26
27 #include <sys/types.h>
28 #include <sys/stat.h>
29
30 #ifdef GIT_WIN32
31
32 # include <io.h>
33 # include <direct.h>
34 # include <windows.h>
35 # include "msvc-compat.h"
36 # include "mingw-compat.h"
37
38 # define snprintf _snprintf
39
40 typedef SSIZE_T ssize_t;
41
42 #else
43
44 # include <unistd.h>
45 # include <arpa/inet.h>
46
47 #endif
48
49 #include "git/common.h"
50 #include "util.h"
51 #include "thread-utils.h"
52 #include "errors.h"
53
54 #define GIT_PATH_MAX 4096
55
56 #endif /* INCLUDE_common_h__ */