]> git.proxmox.com Git - libgit2.git/blame - src/common.h
errors: Add error handling function
[libgit2.git] / src / common.h
CommitLineData
76a8c447
AE
1#ifndef INCLUDE_common_h__
2#define INCLUDE_common_h__
3
cfe3a027
RJ
4/** Force 64 bit off_t size on POSIX. */
5#define _FILE_OFFSET_BITS 64
6
a1c0728d 7#if defined(_WIN32) && !defined(__CYGWIN__)
840fb8b7
RJ
8#define GIT_WIN32 1
9#endif
10
44908fe7 11#include "git2/thread-utils.h"
8a086f87 12#include "cc-compat.h"
b3039bee 13
8a086f87
RJ
14#ifdef GIT_HAVE_INTTYPES_H
15# include <inttypes.h>
16#endif
75d58430 17#include <assert.h>
76a8c447 18#include <errno.h>
028ef0de 19#include <limits.h>
76a8c447 20#include <stdlib.h>
840fb8b7 21#include <stdio.h>
76a8c447
AE
22#include <string.h>
23
840fb8b7 24#include <sys/types.h>
90d4d2f0 25#include <sys/stat.h>
840fb8b7
RJ
26
27#ifdef GIT_WIN32
28
29# include <io.h>
502acd16 30# include <direct.h>
79ca2edc 31# include <windows.h>
e8cc449f
RJ
32# include "msvc-compat.h"
33# include "mingw-compat.h"
bb3de0c4
VM
34# ifdef GIT_THREADS
35# include "win32/pthread.h"
36#endif
79ca2edc 37
8a086f87 38# define snprintf _snprintf
840fb8b7 39
04e88240
RJ
40typedef SSIZE_T ssize_t;
41
840fb8b7 42#else
840fb8b7 43# include <unistd.h>
840fb8b7
RJ
44# include <arpa/inet.h>
45
bb3de0c4
VM
46# ifdef GIT_THREADS
47# include <pthread.h>
48# endif
840fb8b7
RJ
49#endif
50
44908fe7 51#include "git2/common.h"
e52e38d3 52#include "git2/types.h"
64a47c01 53#include "util.h"
028ef0de 54#include "thread-utils.h"
5dddf7c8 55#include "bswap.h"
5ee2fe77
RJ
56
57#define GIT_PATH_MAX 4096
58
02f9e637
VM
59extern int git__error(int error, const char *, ...) GIT_FORMAT_PRINTF(2, 3);
60
76a8c447 61#endif /* INCLUDE_common_h__ */