]> git.proxmox.com Git - libgit2.git/blob - src/common.h
Fix the build on Emscripten
[libgit2.git] / src / common.h
1 /*
2 * Copyright (C) 2009-2011 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_common_h__
8 #define INCLUDE_common_h__
9
10 #include "git2/common.h"
11 #include "cc-compat.h"
12
13 #include <assert.h>
14 #include <errno.h>
15 #include <limits.h>
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <string.h>
19
20 #include <sys/types.h>
21 #include <sys/stat.h>
22
23 #ifdef GIT_WIN32
24
25 # include <io.h>
26 # include <direct.h>
27 # include <windows.h>
28 # include "win32/msvc-compat.h"
29 # include "win32/mingw-compat.h"
30 # ifdef GIT_THREADS
31 # include "win32/pthread.h"
32 #endif
33
34 # define snprintf _snprintf
35
36 #else
37 # include <unistd.h>
38
39 # ifdef GIT_THREADS
40 # include <pthread.h>
41 # endif
42 #endif
43
44 #include "git2/types.h"
45 #include "git2/errors.h"
46 #include "thread-utils.h"
47 #include "bswap.h"
48
49 extern void git___throw(const char *, ...) GIT_FORMAT_PRINTF(1, 2);
50 #define git__throw(error, ...) \
51 (git___throw(__VA_ARGS__), error)
52
53 extern void git___rethrow(const char *, ...) GIT_FORMAT_PRINTF(1, 2);
54 #define git__rethrow(error, ...) \
55 (git___rethrow(__VA_ARGS__), error)
56
57 #include "util.h"
58
59
60 #endif /* INCLUDE_common_h__ */