]> git.proxmox.com Git - libgit2.git/blob - src/common.h
Merge pull request #260 from nulltoken/fix/git_index_add
[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 "git2/thread-utils.h"
12 #include "cc-compat.h"
13
14 #ifdef GIT_HAVE_INTTYPES_H
15 # include <inttypes.h>
16 #endif
17 #include <assert.h>
18 #include <errno.h>
19 #include <limits.h>
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <string.h>
23
24 #include <sys/types.h>
25 #include <sys/stat.h>
26
27 #ifdef GIT_WIN32
28
29 # include <io.h>
30 # include <direct.h>
31 # include <windows.h>
32 # include "msvc-compat.h"
33 # include "mingw-compat.h"
34 # ifdef GIT_THREADS
35 # include "win32/pthread.h"
36 #endif
37
38 # define snprintf _snprintf
39
40 typedef SSIZE_T ssize_t;
41
42 #else
43 # include <unistd.h>
44
45 # ifdef GIT_THREADS
46 # include <pthread.h>
47 # endif
48 #endif
49
50 #include "git2/common.h"
51 #include "git2/types.h"
52 #include "git2/errors.h"
53 #include "thread-utils.h"
54 #include "bswap.h"
55
56 #define GIT_PATH_MAX 4096
57 extern int git__throw(int error, const char *, ...) GIT_FORMAT_PRINTF(2, 3);
58 extern int git__rethrow(int error, const char *, ...) GIT_FORMAT_PRINTF(2, 3);
59
60 #include "util.h"
61
62 #endif /* INCLUDE_common_h__ */