Add noreturn declaration compatible with the MSVC compiler.
[libgit2.git] / src / common.h
blobd4b9769056bc3f7d22860c87fffbe9d4a9065c03
1 #ifndef INCLUDE_common_h__
2 #define INCLUDE_common_h__
4 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
5 #define GIT_WIN32 1
6 #endif
8 #include "git/thread-utils.h"
9 #include "cc-compat.h"
11 #ifdef GIT_HAS_PTHREAD
12 # include <pthread.h>
13 #endif
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>
24 #include <sys/types.h>
26 #ifdef GIT_WIN32
28 # include <io.h>
29 # include <direct.h>
30 # include <windows.h>
32 # define snprintf _snprintf
34 # if (defined(_MSC_VER) && defined(_WIN64)) || \
35 (defined(__DMC__) && defined(_M_AMD64))
36 typedef long long ssize_t;
37 # else
38 typedef int ssize_t;
39 # endif
41 # if defined(_MSC_VER)
42 /* access() mode parameter #defines */
43 # define F_OK 0 /* existence check */
44 # define W_OK 2 /* write mode check */
45 # define R_OK 4 /* read mode check */
46 # endif
48 #else
50 # include <unistd.h>
51 # include <arpa/inet.h>
53 #endif
55 #include "git/common.h"
56 #include "util.h"
57 #include "thread-utils.h"
58 #include "errors.h"
60 #define GIT_PATH_MAX 4096
62 #ifndef GIT_HAVE_INTTYPES_H
63 /* add some missing <stdint.h> typedef's */
64 typedef long int32_t;
65 typedef unsigned long uint32_t;
67 typedef long long int64_t;
68 typedef unsigned long long uint64_t;
69 #endif
71 #endif /* INCLUDE_common_h__ */