1 /*
2    The big fat ifdef-rich configuration header for the HERMES library
3    Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
4    This source code is licensed under the GNU LGPL
5 
6    Please refer to the file COPYING contained in the distribution for
7    licensing conditions
8 */
9 #if defined X86_ASSEMBLER && defined __BORLANDC__
10 //#undef X86_ASSEMBLER
11 #endif
12 
13 #ifndef __HERMES_CONF_H__
14 #define __HERMES_CONF_H__
15 
16 
17 #define HERMES_INITIAL 8             /* Initial size and growth of dynamic */
18 #define HERMES_GROWTH 4              /* array structures */
19 
20 #ifdef __unix__
21 #ifndef __DJGPP__
22 #include "hrconfig.h"
23 #endif
24 #endif
25 
26 
27 #ifdef __CYGWIN32__
28   #define __CYGNUS__
29 #endif /* CYGWIN32 */
30 
31 #if (_MSC_VER>=1000)
32   #define __VISUALC__
33 #endif /* MSC_VER */
34 
35 
36 #if defined(WIN32) || defined(_WIN32) || defined(WINDOWS) || defined(__NT__)
37   #define __WIN32__ 1
38   #define __LITTLE_ENDIAN__ 1
39   #undef __BIG_ENDIAN__
40   #define X86_ASSEMBLER 1
41 #endif /* WIN32 */
42 
43 #if defined (__sun)
44   #define __BIG_ENDIAN__
45   #undef __LITTLE_ENDIAN__ 1
46 #endif
47 
48 #if defined(__WATCOMC__) || defined(__DJGPP__) || defined(__CYGNUS__)
49   #define __LITTLE_ENDIAN__ 1
50   #undef __BIG_ENDIAN__
51 #endif /* __WATCOMC__ */
52 
53 
54 #if defined (__WATCOMC__)
55   #define STACKCALL cdecl
56 #else
57   #define STACKCALL
58 #endif /* __WATCOMC__ */
59 
60 
61 #if defined ( __BEOS__ )
62 #  if defined ( __INTEL__ )
63 #    define __LITTLE_ENDIAN__ 1
64 #    undef __BIG_ENDIAN__
65 #  else
66 #    define __BIG_ENDIAN__ 1
67 #    undef __LITTLE_ENDIAN__
68 #  endif
69 #endif /* __BEOS__ */
70 
71 
72 
73 
74 /* Macros to help with big/little endian problems */
75 
76 #if defined __LITTLE_ENDIAN__
77   #define A_32 3		   /* oh yes, hardcode it... tsk tsk tsk */
78   #define R_32 2                   /* Position of R,G,B in a 32 bit dword */
79   #define G_32 1
80   #define B_32 0
81   #define R_24 2                   /* Position of R,G,B in a 24 bit pixel */
82   #define G_24 1
83   #define B_24 0
84   #define DWORD_BYTE0(s) s         /* Shift values to get to bytes in dwords */
85   #define DWORD_BYTE1(s) ((s)<<8)  /* Check out the bracket paranoia to */
86   #define DWORD_BYTE2(s) ((s)<<16) /* prevent bugs :)) */
87   #define DWORD_BYTE3(s) ((s)<<24)
88   #define DWORD_SHORT0(s) s
89   #define DWORD_SHORT1(s) ((s)<<16)
90   #define DWORD_SHORT0(s) s
91   #define DWORD_SHORT1(s) ((s)<<16)
92 #elif defined __BIG_ENDIAN__
93   #define A_32 0
94   #define R_32 1
95   #define G_32 2
96   #define B_32 3
97   #define R_24 0
98   #define G_24 1
99   #define B_24 2
100   #define DWORD_BYTE0(s) ((s)<<24)
101   #define DWORD_BYTE1(s) ((s)<<16)
102   #define DWORD_SHORT0(s) ((s)<<16)
103   #define DWORD_SHORT1(s) s
104   #define DWORD_BYTE2(s) ((s)<<8)
105   #define DWORD_BYTE3(s) s
106   #define DWORD_SHORT0(s) ((s)<<16)
107   #define DWORD_SHORT1(s) s
108 #else
109   #error Processor endian-ness not defined!
110 #endif
111 
112 #endif
113 
114 
115