Updated interpreters
[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 // Define this to use an OS-specific git_powf() power math function. This
23 // is useful if your compiler's powf() doesn't implement every special case
24 // of the C99 standard.
25 // #define USE_OWN_POWF
26
27 // -------------------------------------------------------------------
28
29 // Make sure we're compiling for a sane platform. For now, this means
30 // 8-bit bytes and 32-bit pointers. We'll support 64-bit machines at
31 // some point in the future, but we will probably never support machines
32 // that can't read memory 8 bits at a time; it's just too much hassle.
33
34 #include <limits.h>
35
36 #if CHAR_BIT != 8
37 #error "Git needs 8-bit bytes"
38 #endif
39
40 // This check doesn't work on all compilers, unfortunately.
41 // It's checked by an assert() at runtime in initCompiler().
42 #if 0
43 // #if sizeof(void*) != 4
44 #error "Git needs 32-bit pointers"
45 #endif
46
47 // Now we determine what types to use for 8-bit, 16-bit and 32-bit ints.
48
49 #if UCHAR_MAX==0xff
50 typedef signed char   git_sint8;
51 typedef unsigned char git_uint8;
52 #else
53 #error "Can't find an 8-bit integer type"
54 #endif
55
56 #if SHRT_MAX==0x7fff
57 typedef signed   short git_sint16;
58 typedef unsigned short git_uint16;
59 #elif INT_MAX==0x7fff
60 typedef signed   int git_sint16;
61 typedef unsigned int git_uint16;
62 #else
63 #error "Can't find a 16-bit integer type"
64 #endif
65
66 #if INT_MAX==0x7fffffff
67 typedef signed   int git_sint32;
68 typedef unsigned int git_uint32;
69 #elif LONG_MAX==0x7fffffff
70 typedef signed   long git_sint32;
71 typedef unsigned long git_uint32;
72 #else
73 #error "Can't find a 32-bit integer type"
74 #endif
75
76 // USE_INLINE is pretty simple to deal with.
77
78 #ifdef USE_INLINE
79 #define GIT_INLINE static inline
80 #else
81 #define GIT_INLINE static
82 #endif
83
84 typedef float git_float;
85
86 #endif // GIT_CONFIG_H