]> git.proxmox.com Git - libgit2.git/blame - src/common.h
Add assembly sha1 implementation for ppc
[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
d44cfd46 11#include "git/thread-utils.h"
8a086f87 12#include "cc-compat.h"
b3039bee 13
a1d34bc0
SP
14#ifdef GIT_HAS_PTHREAD
15# include <pthread.h>
16#endif
8a086f87
RJ
17#ifdef GIT_HAVE_INTTYPES_H
18# include <inttypes.h>
19#endif
75d58430 20#include <assert.h>
76a8c447 21#include <errno.h>
028ef0de 22#include <limits.h>
76a8c447 23#include <stdlib.h>
840fb8b7 24#include <stdio.h>
76a8c447
AE
25#include <string.h>
26
840fb8b7 27#include <sys/types.h>
90d4d2f0 28#include <sys/stat.h>
840fb8b7
RJ
29
30#ifdef GIT_WIN32
31
32# include <io.h>
502acd16 33# include <direct.h>
79ca2edc
RJ
34# include <windows.h>
35
8a086f87 36# define snprintf _snprintf
840fb8b7 37
04e88240
RJ
38# if defined(__DMC__)
39# if defined(_M_AMD64)
40# define SSIZE_T long long
41# else
42# define SSIZE_T int
43# endif
8a086f87
RJ
44# endif
45
04e88240
RJ
46typedef SSIZE_T ssize_t;
47
8a086f87
RJ
48# if defined(_MSC_VER)
49/* access() mode parameter #defines */
50# define F_OK 0 /* existence check */
51# define W_OK 2 /* write mode check */
52# define R_OK 4 /* read mode check */
53# endif
840fb8b7 54
90d4d2f0
RJ
55#if defined(__MINGW32__)
56
57# define off_t off64_t
58# define lseek _lseeki64
59# define stat _stati64
60# define fstat _fstati64
61
62#elif defined(_MSC_VER)
63
64typedef __int64 off64_t;
65# define off_t off64_t
66# define lseek _lseeki64
67# define stat _stat64
68# define fstat _fstat64
69
70#endif
71
840fb8b7
RJ
72#else
73
74# include <unistd.h>
840fb8b7
RJ
75# include <arpa/inet.h>
76
77#endif
78
2c4b7707 79#include "git/common.h"
64a47c01 80#include "util.h"
028ef0de 81#include "thread-utils.h"
d44cfd46 82#include "errors.h"
5ee2fe77
RJ
83
84#define GIT_PATH_MAX 4096
85
8a086f87
RJ
86#ifndef GIT_HAVE_INTTYPES_H
87/* add some missing <stdint.h> typedef's */
88typedef long int32_t;
89typedef unsigned long uint32_t;
90
91typedef long long int64_t;
92typedef unsigned long long uint64_t;
93#endif
94
76a8c447 95#endif /* INCLUDE_common_h__ */