Debian Codegraph @

terps/git/config.h

raw symbols SCIP
1 // $Id: config.h,v 1.4 2003/10/18 23:19:52 iain Exp $
2 // Platform-dependent configuration for Git
3
4 #ifndef GIT_CONFIG_H
5 #define GIT_CONFIG_H
6
7 // Various compile-time options. You can define them in the
8 // makefile or uncomment them here, whichever's easiest.
9
10 // Define if we're big-endian.
11 // #define USE_BIG_ENDIAN
12
13 // Define if we're big-endian and can read and write unaligned data.
14 // #define USE_BIG_ENDIAN_UNALIGNED
15
16 // Define this to use GCC's labels-as-values extension for a big speedup.
17 // #define USE_DIRECT_THREADING
18
19 // Define this if we can use the "inline" keyword.
20 // #define USE_INLINE
21
22 // Define this to use a function native_random() to get random numbers.
23 // #define USE_NATIVE_RANDOM
24
25 // Define this to memory-map the game file to speed up loading. (Unix-specific)
26 // #define USE_MMAP
27
28 // -------------------------------------------------------------------
29
30 // Make sure we're compiling for a sane platform. For now, this means
31 // 8-bit bytes and 32-bit pointers. We'll support 64-bit machines at
32 // some point in the future, but we will probably never support machines
33 // that can't read memory 8 bits at a time; it's just too much hassle.
34
35 #include <limits.h>
36
37 #if CHAR_BIT != 8
38 #error "Git needs 8-bit bytes"
39 #endif
40
41 // This check doesn't work on all compilers, unfortunately.
42 // It's checked by an assert() at runtime in initCompiler().
43 #if 0
44 // #if sizeof(void*) != 4
45 #error "Git needs 32-bit pointers"
46 #endif
47
48 // Now we determine what types to use for 8-bit, 16-bit and 32-bit ints.
49
50 #if UCHAR_MAX==0xff
51 typedef signed char git_sint8;
52 typedef unsigned char git_uint8;
53 #else
54 #error "Can't find an 8-bit integer type"
55 #endif
56
57 #if SHRT_MAX==0x7fff
58 typedef signed short git_sint16;
59 typedef unsigned short git_uint16;
60 #elif INT_MAX==0x7fff
61 typedef signed int git_sint16;
62 typedef unsigned int git_uint16;
63 #else
64 #error "Can't find a 16-bit integer type"
65 #endif
66
67 #if INT_MAX==0x7fffffff
68 typedef signed int git_sint32;
69 typedef unsigned int git_uint32;
70 #elif LONG_MAX==0x7fffffff
71 typedef signed long git_sint32;
72 typedef unsigned long git_uint32;
73 #else
74 #error "Can't find a 32-bit integer type"
75 #endif
76
77 // USE_INLINE is pretty simple to deal with.
78
79 #ifdef USE_INLINE
80 #define GIT_INLINE static inline
81 #else
82 #define GIT_INLINE static
83 #endif
84
85 typedef float git_float;
86 typedef double git_double;
87
88
89 #if defined(__GNUC__)
90 // GCC and compatible compilers such as clang
91 # define maybe_unused __attribute__((__unused__))
92 # define git_noreturn __attribute__((__noreturn__))
93 #elif defined(_MSC_VER)
94 // Microsoft Visual Studio
95 # define maybe_unused
96 # define git_noreturn __declspec(noreturn)
97 #else
98 # define maybe_unused
99 # define git_noreturn
100 #endif
101
102 #endif // GIT_CONFIG_H