d1dea0af65cd6c7af9f6ce144484de5a1823063a
[projects/chimara/chimara.git] / interpreters / git / config.h
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 and can read and write unaligned data.
11 // #define USE_BIG_ENDIAN_UNALIGNED
12
13 // Define this to use GCC's labels-as-values extension for a big speedup.
14 // #define USE_DIRECT_THREADING
15
16 // Define this if we can use the "inline" keyword.
17 // #define USE_INLINE
18
19 // Define this to memory-map the game file to speed up loading. (Unix-specific)
20 // #define USE_MMAP
21
22 // -------------------------------------------------------------------
23
24 // Make sure we're compiling for a sane platform. For now, this means
25 // 8-bit bytes and 32-bit pointers. We'll support 64-bit machines at
26 // some point in the future, but we will probably never support machines
27 // that can't read memory 8 bits at a time; it's just too much hassle.
28
29 #include <limits.h>
30
31 #if CHAR_BIT != 8
32 #error "Git needs 8-bit bytes"
33 #endif
34
35 // This check doesn't work on all compilers, unfortunately.
36 // It's checked by an assert() at runtime in initCompiler().
37 #if 0
38 // #if sizeof(void*) != 4
39 #error "Git needs 32-bit pointers"
40 #endif
41
42 // Now we determine what types to use for 8-bit, 16-bit and 32-bit ints.
43
44 #if UCHAR_MAX==0xff
45 typedef signed char   git_sint8;
46 typedef unsigned char git_uint8;
47 #else
48 #error "Can't find an 8-bit integer type"
49 #endif
50
51 #if SHRT_MAX==0x7fff
52 typedef signed   short git_sint16;
53 typedef unsigned short git_uint16;
54 #elif INT_MAX==0x7fff
55 typedef signed   int git_sint16;
56 typedef unsigned int git_uint16;
57 #else
58 #error "Can't find a 16-bit integer type"
59 #endif
60
61 #if INT_MAX==0x7fffffff
62 typedef signed   int git_sint32;
63 typedef unsigned int git_uint32;
64 #elif LONG_MAX==0x7fffffff
65 typedef signed   long git_sint32;
66 typedef unsigned long git_uint32;
67 #else
68 #error "Can't find a 32-bit integer type"
69 #endif
70
71 // USE_INLINE is pretty simple to deal with.
72
73 #ifdef USE_INLINE
74 #define GIT_INLINE static inline
75 #else
76 #define GIT_INLINE static
77 #endif
78
79 #endif // GIT_CONFIG_H