checkin of 0.3.0
[pspp-builds.git] / pref.h.orig
1 /* Let's tell EMACS what language this is: -*- C -*- */
2
3 /* Used by separable libraries to enable PSPP-specific features. */
4 #define PSPP 1
5
6 /*
7  *
8  * Debugging
9  *
10  */
11
12 /* Define to get lots of info printed by procedures. */
13 /*#define DEBUGGING 1*/
14
15 #if DEBUGGING
16 #define GLOBAL_DEBUGGING 1
17 #endif
18
19 /* Define these if DEBUGGING is off and you want to make certain
20    additional optimizations. */
21 #if !DEBUGGING
22 /* #define PRODUCTION 1 */              /* disable extra function calls */
23 /* #define NDEBUG 1 */                  /* disable assert() sanity checks */
24 #endif
25 \f
26 /* Compilers. */
27
28 /* Fix Windows lossage. */
29 #ifdef __WIN32__
30 #undef __WIN32__
31 #define __WIN32__ 1
32 #undef __MSDOS__
33 #define __MSDOS__ 1
34 #endif
35
36 /* Fix DJGPP lossage. */
37 #if __DJGPP__
38 #undef unix
39 #undef __unix__
40 #endif
41
42 /* Fix Cygnus Windows lossage. */
43 #if defined (__CYGWIN32__)
44 #define unix 1
45 #endif
46
47 /* Ensure that unix and __unix__ are equivalent. */
48 #if defined (unix) || defined (__unix__) || defined (__unix)
49 #undef unix
50 #define unix 1
51
52 #undef __unix__
53 #define __unix__ 1
54
55 #undef __unix
56 #define __unix 1
57 #endif
58
59 /* Make sure to use the proper keywords. */
60 #if __GNUC__ > 1 && !defined (inline)
61 #define inline __inline__
62 #endif
63
64 /* GNU C allows the programmer to declare that certain functions take
65    printf-like arguments, never return, etc.  Conditionalize these
66    declarations on whether gcc is in use. */
67 #if __GNUC__ > 1
68 #define __attribute__(X) __attribute__ (X)
69 #else
70 #define __attribute__(X)
71 #endif
72
73 /* GNU C allows unused variables and parameters to be declared as
74    such. */
75 #if __GNUC__ >= 2
76 #define unused __attribute__ ((__unused__))
77 #else
78 #define unused
79 #endif
80 \f
81 /* CPUs. */
82
83 /* Check that the floating-point representation is one that we
84    understand. */
85 #if FPREP==FPREP_IEEE754
86      
87 #if SIZEOF_DOUBLE == 8
88 #define second_lowest_flt64 second_lowest_value
89 #else
90 #error Must define second_lowest_flt64 for your architecture.
91 #endif
92
93 /* This trick borrowed from gcc-lib/.../include/float.h. */
94 #if __GNUC__ && (ENDIAN==BIG || ENDIAN==LITTLE)
95 #ifndef __DBL_UNION__
96 #define __DBL_UNION__
97 union blp_convert_double {
98   unsigned char convert_double_i[8];
99   double convert_double_d;
100 };
101 #endif /* !defined __DBL_UNION__ */
102 #if ENDIAN==LITTLE
103 #define SECOND_LOWEST_VALUE                                             \
104         (__extension__ ((union blp_convert_double)                      \
105                         {{0xfe,0xff,0xff,0xff, 0xff,0xff,0xef,0xff}})   \
106          .convert_double_d)
107 #elif ENDIAN==BIG
108 #define SECOND_LOWEST_VALUE                                             \
109         (__extension__ ((union blp_convert_double)                      \
110                         {{0xff,0xef,0xff,0xff, 0xff,0xff,0xff,0xfe}})   \
111          .convert_double_d)
112 #endif /* endianness */
113 #endif /* __GNUC__ and known endianness */
114
115 #else /* FPREP != FPREP_IEEE754 */
116 #error Floating point representation must be known at compile time.
117 #endif /* fprep */
118
119 /* Figure out which integer type on this system is a signed 32-bit
120    integer. */
121 #if SIZEOF_SHORT==4
122   #define int32 short
123 #elif SIZEOF_INT==4
124   #define int32 int
125 #elif SIZEOF_LONG==4
126   #define int32 long
127 #else
128   #error Which one of your basic types is 32-bit signed integer?
129 #endif
130
131 #if SIZEOF_FLOAT==8
132   #define flt64 float
133   #define FLT64_MAX FLT_MAX
134 #elif SIZEOF_DOUBLE==8
135   #define flt64 double
136   #define FLT64_MAX DBL_MAX
137 #elif SIZEOF_LONG_DOUBLE==8
138   #define flt64 long double
139   #define FLT64_MAX LDBL_MAX
140 #else
141   #error Which one of your basic types is 64-bit floating point?
142   #define flt64 double
143   #define FLT64_MAX DBL_MAX
144 #endif
145 \f
146 /* Environments. */
147
148 /* Internationalization. */
149 #include <libintl.h>
150
151 #if !ENABLE_NLS
152 /* If we don't do this then gettext() still monkeys with the string,
153    which causes gcc not to do its checking on printf() format
154    types. */
155 #undef gettext
156 #define gettext(STRING)                         \
157         STRING
158 #endif
159
160 #define _(STRING)                               \
161         gettext(STRING)
162      
163 #define N_(STRING)                              \
164         STRING
165
166 /* Even C emulation of alloca counts as an alloca implementation. */
167 #if C_ALLOCA
168 #define HAVE_ALLOCA 1
169 #endif
170
171 /* Define PAGED_STACK if alloca() is supported and the stack can
172    expand arbitrarily.  (Under some broken OSes like DOS and
173    Windows the stack is small and fixed in size.)  This will prevent
174    big alloca() requests (like 1MB). */
175 #if HAVE_ALLOCA && unix
176 #define PAGED_STACK 1
177 #endif
178
179 /* Saves on #if's. */
180 #if HAVE_ALLOCA && !__CHECKER__
181 #define local_alloc(X)                          \
182         alloca(X)
183
184 #define local_free(P)                           \
185         do                                      \
186           {                                     \
187           }                                     \
188         while (0)
189 #elif !__CHECKER__
190 #define local_alloc(X)                          \
191         xmalloc (X)
192      
193 #define local_free(P)                           \
194         free (P)
195 #else /* __CHECKER__ */
196 /* Why define these this way?  Because if you do it this way then if
197    you try to free a block returned by local_alloc() with the free()
198    function, you get an error message. */
199 #define local_alloc(X)                                  \
200         ((void *) (((char *) (xmalloc (X+16))) + 16))
201
202 #define local_free(P)                           \
203         free (((char *) P) - 16)
204 #endif /* __CHECKER__ */
205 \f
206 /* Filesystems. */
207
208 /* Directory separator character for this OS, if applicable. */
209 #if !__MSDOS__
210 #define DIR_SEPARATOR '/'
211 #elif
212 #define DIR_SEPARATOR '\\'
213 #endif
214
215 /* Path delimiter character. */
216 #if !__MSDOS__
217 #define PATH_DELIMITER ':'
218 #else
219 #define PATH_DELIMITER ';'
220 #endif
221
222 /* MSDOS mkdir() takes only one argument. */
223 #if __MSDOS__ && !__DJGPP__
224 #define mkdir(path, mode)                       \
225         mkdir (path)
226 #endif
227 \f
228 /* Options. */
229
230 /* Approximate amount of memory, in bytes, to allocate before paging
231    to disk.  */
232 #define MAX_WORKSPACE (4*1024*1024)     /* 4 MBytes */
233
234 /* (libhistory) The location for the history file that records
235    commands entered interactively.  Tilde expansion is performed. */
236 #define HISTORY_FILE "~/.pspp_history"
237
238 /* (libhistory) Maximum number of commands to record in history
239    file. */
240 #define MAX_HISTORY 500
241 \f
242 /* Output drivers. */
243
244 /* Define to exclude the HTML output driver. */
245 /* #define NO_HTML 1 */
246
247 /* Define to exclude the PostScript and Encapsulated PostScript
248    driver. */
249 /* #define NO_POSTSCRIPT 1 */
250 \f
251 /* Procedure-specific options. */
252
253 /* CROSSTABS: Maximum number of tables to process in one pass. */
254 #define MAX_CROSSTAB_TABLES 32
255
256 /* FREQUENCIES: Define to allow bars greater than 1/2" wide. */
257 /* #define ALLOW_HUGE_BARS 1 */
258
259 /* FREQUENCIES: Minimum, maximum number of bars in a histogram.  The
260    number is based on the number of unique values of the variable,
261    unless overridden.  */
262 #define MIN_HIST_BARS 3
263 #define MAX_HIST_BARS 20
264
265 /* FREQUENCIES: Density of polyline used to approximate the normal
266    curve.  The value is the number of samples taken per chart.  Higher
267    values give smoother curves.  */
268 #define POLYLINE_DENSITY (MAX_HIST_BARS*4)