1 | /******************************************************************* |
---|
2 | * Computer Algebra System SINGULAR |
---|
3 | * |
---|
4 | * mod2.h: Main configuration file for Singular |
---|
5 | * DO NOT EDIT! |
---|
6 | * |
---|
7 | * Version: $Id: mod2.h.in,v 1.78 1999-11-29 13:01:28 obachman Exp $ |
---|
8 | *******************************************************************/ |
---|
9 | #ifndef MOD2_H |
---|
10 | #define MOD2_H |
---|
11 | |
---|
12 | /******************************************************************* |
---|
13 | * Defines which are set by configure |
---|
14 | ******************************************************************/ |
---|
15 | /* Define to use dynamic linking */ |
---|
16 | #undef HAVE_DL |
---|
17 | /* Define to use readline lib for fancy display */ |
---|
18 | #undef HAVE_READLINE |
---|
19 | /* Define to use built-in command line parser */ |
---|
20 | #undef HAVE_FEREAD |
---|
21 | /* Define if you want to use dld's */ |
---|
22 | #undef HAVE_DLD |
---|
23 | /* Define to have dbm links */ |
---|
24 | #undef HAVE_DBM |
---|
25 | /* Define to have smallgmp */ |
---|
26 | #undef HAVE_SMALLGMP |
---|
27 | /* Define to have MP links */ |
---|
28 | #undef HAVE_MPSR |
---|
29 | /* Define to have factory functionality added */ |
---|
30 | #undef HAVE_FACTORY |
---|
31 | /* Define to have libfac functionality added */ |
---|
32 | #undef HAVE_LIBFAC_P |
---|
33 | /* Define if you have stdc headers */ |
---|
34 | #undef STDC_HEADERS |
---|
35 | /* Define if you have asm/sigcontext.h */ |
---|
36 | #undef HAVE_ASM_SIGCONTEXT_H |
---|
37 | /* Define if you have sys/file.h */ |
---|
38 | #undef HAVE_SYS_FILE_H |
---|
39 | /* Define if you have sys/stat.h */ |
---|
40 | #undef HAVE_SYS_STAT_H |
---|
41 | /* Define if you have sys/param.h */ |
---|
42 | #undef HAVE_SYS_PARAM_H |
---|
43 | /* Define if you have sys/file.h */ |
---|
44 | #undef HAVE_SYS_TYPES_H |
---|
45 | /* Define if you have sys/ioctl.h */ |
---|
46 | #undef HAVE_SYS_IOCTL_H |
---|
47 | /* Define if you have sys/time.h */ |
---|
48 | #undef HAVE_SYS_TIME_H |
---|
49 | /* Define if you have sys/times.h */ |
---|
50 | #undef HAVE_SYS_TIMES_H |
---|
51 | /* io header: */ |
---|
52 | /* Define if you have termcap.h */ |
---|
53 | #undef HAVE_TERMCAP_H |
---|
54 | /* Define if you have termios.h */ |
---|
55 | #undef HAVE_TERMIOS_H |
---|
56 | /* Define if you have term.h */ |
---|
57 | #undef HAVE_TERM_H |
---|
58 | /* Define if you have readline/history.h */ |
---|
59 | #undef HAVE_READLINE_HISTORY_H |
---|
60 | /* Define if readline/readline.h is ok */ |
---|
61 | #undef READLINE_READLINE_H_OK |
---|
62 | /* Define if time.h and sys/time.h can be included at the same time */ |
---|
63 | #undef TIME_WITH_SYS_TIME |
---|
64 | /* Define if you have alloca.h */ |
---|
65 | #undef HAVE_ALLOCA_H |
---|
66 | /* Define if you have pwd.h */ |
---|
67 | #undef HAVE_PWD_H |
---|
68 | /* Define if you have unistd.h */ |
---|
69 | #undef HAVE_UNISTD_H |
---|
70 | /* define if you have malloc.h */ |
---|
71 | #undef HAVE_MALLOC_H |
---|
72 | /* define if you have pwd.h*/ |
---|
73 | #undef HAVE_PWD_H |
---|
74 | /* Define if you have alloca */ |
---|
75 | #undef HAVE_ALLOCA |
---|
76 | /* Define if you have getpagesize */ |
---|
77 | #undef GETPAGESIZE |
---|
78 | /* Define if you have vprintf */ |
---|
79 | #undef HAVE_VPRINTF |
---|
80 | /* Define if you have gettimeofday */ |
---|
81 | #undef HAVE_GETTIMEOFDAY |
---|
82 | /* Define if you have atexit */ |
---|
83 | #undef HAVE_ATEXIT |
---|
84 | /* Define if you have bcopy, bzero and bcmp |
---|
85 | Linux needs that define! */ |
---|
86 | #undef HAVE_BCOPY |
---|
87 | /* Define if sprintf does not return number of printed chars */ |
---|
88 | #undef BSD_SPRINTF |
---|
89 | /* define if you have explicit C++ constructors */ |
---|
90 | #undef HAVE_EXPLICIT_CONSTR |
---|
91 | /* Define if you have the getcwd function. */ |
---|
92 | #undef HAVE_GETCWD |
---|
93 | /* Define if you have the getwd function. */ |
---|
94 | #undef HAVE_GETWD |
---|
95 | /* Define if you have snprintf */ |
---|
96 | #undef HAVE_VSNPRINTF |
---|
97 | /* Define if you have sbrk */ |
---|
98 | #undef HAVE_SBRK |
---|
99 | /* Define if you have readlink */ |
---|
100 | #undef HAVE_READLINK |
---|
101 | /* Define if you have usleep */ |
---|
102 | #undef HAVE_USLEEP |
---|
103 | /* Define if you have sleep */ |
---|
104 | #undef HAVE_SLEEP |
---|
105 | /* Define if you have setenv */ |
---|
106 | #undef HAVE_SETENV |
---|
107 | /* Define if you have petpwnam */ |
---|
108 | #undef HAVE_GETPWNAM |
---|
109 | /* Define sizeof(char) */ |
---|
110 | #define SIZEOF_CHAR 1 |
---|
111 | /* Define sizeof(short) */ |
---|
112 | #define SIZEOF_SHORT 2 |
---|
113 | /* Define sizeof(int) */ |
---|
114 | #define SIZEOF_INT 4 |
---|
115 | /* Define sizeof(long) */ |
---|
116 | #define SIZEOF_LONG 4 |
---|
117 | /* Define sizeof(void*) */ |
---|
118 | #define SIZEOF_VOIDP 4 |
---|
119 | /* Define sizeof(double) */ |
---|
120 | #define SIZEOF_DOUBLE 8 |
---|
121 | /* Define if your integer format is big endian */ |
---|
122 | #undef WORDS_BIGENDIAN |
---|
123 | /* Define the type of the exponents to be used in monomials */ |
---|
124 | #define EXPONENT_TYPE short |
---|
125 | /* Define the size of exponent */ |
---|
126 | #define SIZEOF_EXPONENT SIZEOF_SHORT |
---|
127 | /* Define major version of Singular -- should be set in ../configure.in!!!*/ |
---|
128 | #define SINGULAR_MAJOR_VERSION 0 |
---|
129 | /* Define minor version of Singular -- should be set in ../configure.in!!! */ |
---|
130 | #define SINGULAR_MINOR_VERSION 0 |
---|
131 | /* Define sub version of Singular -- should be set in ../configure.in!!! */ |
---|
132 | #define SINGULAR_SUB_VERSION 0 |
---|
133 | /* Define version as a string */ |
---|
134 | #define S_VERSION1 "" |
---|
135 | /* Define version date as a string */ |
---|
136 | #define S_VERSION2 "" |
---|
137 | /* Define uname identifier as a string */ |
---|
138 | #define S_UNAME "" |
---|
139 | /* Absolute pathname of root directory of Singular source */ |
---|
140 | #define S_ROOT_DIR "" |
---|
141 | /* Define if our gmalloc is to be used */ |
---|
142 | #undef HAVE_GMALLOC |
---|
143 | /* Define pagesize of your system */ |
---|
144 | #define SIZE_OF_SYSTEM_PAGE 4096 |
---|
145 | /* size of page as we can use it */ |
---|
146 | #define SIZE_OF_PAGE SIZE_OF_SYSTEM_PAGE |
---|
147 | /* valloc routine which returns chunk of SIZE_OF_PAGE */ |
---|
148 | #define PALLOC malloc |
---|
149 | #define PFREE free |
---|
150 | /* define if you have the MTRACK utilities (only on linux/elf) */ |
---|
151 | #undef HAVE_MTRACK |
---|
152 | |
---|
153 | /******************************************************************* |
---|
154 | * Defines which are not set by configure |
---|
155 | ******************************************************************/ |
---|
156 | /* define to use the dynamic linking of readline in non-distributions builds */ |
---|
157 | /* #undef USE_STATIC_RL */ |
---|
158 | |
---|
159 | /* Default value for timer resolution in ticks per second */ |
---|
160 | /* set to 10 for resolution of tenth of a second, etc */ |
---|
161 | #define TIMER_RESOLUTION 1 |
---|
162 | |
---|
163 | /* Undefine to disable the quote/eval of expressions */ |
---|
164 | #define SIQ 1 |
---|
165 | |
---|
166 | /* Define to enable TCL interface */ |
---|
167 | #undef HAVE_TCL |
---|
168 | |
---|
169 | /* Undefine to disable Gerhard's and Wilfried's fast and dirty std computations */ |
---|
170 | #define FAST_AND_DIRTY |
---|
171 | #ifdef __MWERKS__ |
---|
172 | /* includes for Metrowerks */ |
---|
173 | #include "mod2.mwerks.h" |
---|
174 | #else |
---|
175 | /* works around a quirk in the generation of parser tables */ |
---|
176 | #define INIT_BUG |
---|
177 | #endif |
---|
178 | |
---|
179 | /* linear algebra extensions from pcv.h/pcv.cc */ |
---|
180 | #define HAVE_PCV 1 |
---|
181 | |
---|
182 | /* Define to use old mechanismen for saving currRing with procedures |
---|
183 | * Does not work with HAVE_NAMESPACES enabled |
---|
184 | */ |
---|
185 | #undef USE_IILOCALRING |
---|
186 | |
---|
187 | /* Define to use new namespaces techniks */ |
---|
188 | #undef HAVE_NAMESPACES |
---|
189 | |
---|
190 | /* Define to enable dynamic module code */ |
---|
191 | #undef HAVE_DYNAMIC_LOADING |
---|
192 | |
---|
193 | /* Define to use scanner when loading libraries */ |
---|
194 | #define HAVE_LIBPARSER |
---|
195 | |
---|
196 | /*#define PROFILING*/ |
---|
197 | #ifdef PROFILING |
---|
198 | #define PROFILER ,0,0 |
---|
199 | #else |
---|
200 | #define PROFILER |
---|
201 | #endif |
---|
202 | |
---|
203 | /* Define to use gmp for rational arithmetic */ |
---|
204 | #define HAVE_GMP |
---|
205 | |
---|
206 | /******************************************************************* |
---|
207 | * Evaluate the set defines |
---|
208 | ******************************************************************/ |
---|
209 | /* dynamic readline or readline ? */ |
---|
210 | #ifdef HAVE_DL |
---|
211 | #if !defined(USE_STATIC_RL) |
---|
212 | #define HAVE_DYN_RL |
---|
213 | #endif |
---|
214 | #endif |
---|
215 | |
---|
216 | /* FGLM needs factory */ |
---|
217 | #ifdef HAVE_FACTORY |
---|
218 | #define HAVE_FGLM |
---|
219 | #endif |
---|
220 | |
---|
221 | /* Define if you want fglm for homogeneous case */ |
---|
222 | #ifdef HAVE_FGLM |
---|
223 | #undef HAVE_FGLM_HOME |
---|
224 | #endif |
---|
225 | |
---|
226 | /* Spectrum needs GMP */ |
---|
227 | #ifdef HAVE_GMP |
---|
228 | /* #define HAVE_SPECTRUM */ |
---|
229 | #endif |
---|
230 | |
---|
231 | /* Undefine to disable real time measurments */ |
---|
232 | #ifdef HAVE_GETTIMEOFDAY |
---|
233 | #if ! defined(__MWERKS__) && ! defined(MSDOS) |
---|
234 | #define HAVE_RTIMER |
---|
235 | #else |
---|
236 | #undef HAVE_RTIMER |
---|
237 | #endif |
---|
238 | #endif |
---|
239 | |
---|
240 | #if SIZEOF_VOIDP == 8 |
---|
241 | /* SIZEOF_LONG == SIZEOF_VOIDP is guaranteed by configure */ |
---|
242 | #define ALIGN_8 |
---|
243 | #define LOG_SIZEOF_LONG 3 |
---|
244 | #define LOG_SIZEOF_VOIDP 3 |
---|
245 | #else |
---|
246 | #define LOG_SIZEOF_LONG 2 |
---|
247 | #define LOG_SIZEOF_VOIDP 2 |
---|
248 | #endif |
---|
249 | |
---|
250 | #ifndef CHAR_BIT |
---|
251 | #define CHAR_BIT 8 |
---|
252 | #endif |
---|
253 | |
---|
254 | #define BIT_SIZEOF_LONG CHAR_BIT*SIZEOF_LONG |
---|
255 | |
---|
256 | #define SINGULAR_VERSION (SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION) |
---|
257 | |
---|
258 | #if SIZEOF_EXPONENT == 1 |
---|
259 | #define MAX_EXPONENT 0x7f |
---|
260 | #define MAX_COMPONENT 0xff |
---|
261 | #elif SIZEOF_EXPONENT == 2 |
---|
262 | #define MAX_EXPONENT 0x7fff |
---|
263 | #define MAX_COMPONENT 0xffff |
---|
264 | #else /* SIZEOF_EXPONENT == 4 */ |
---|
265 | #define MAX_EXPONENT 0x7fffffff |
---|
266 | #define MAX_COMPONENT 0xffffffff |
---|
267 | #endif |
---|
268 | |
---|
269 | /******************************************************************* |
---|
270 | * Miscellanous Defines |
---|
271 | ******************************************************************/ |
---|
272 | /* define MM_COUNT to enable "memory(0)" (resp. memory(1))*/ |
---|
273 | #define MM_COUNT 1 |
---|
274 | |
---|
275 | |
---|
276 | #ifndef HAVE_LIBPARSER |
---|
277 | # undef YYLPDEBUG |
---|
278 | #else |
---|
279 | # define YYLPDEBUG 1 |
---|
280 | #endif |
---|
281 | |
---|
282 | #ifndef FALSE |
---|
283 | #define FALSE 0 |
---|
284 | #endif |
---|
285 | |
---|
286 | #ifndef TRUE |
---|
287 | #define TRUE 1 |
---|
288 | #endif |
---|
289 | |
---|
290 | #ifndef NULL |
---|
291 | #define NULL (0) |
---|
292 | #endif |
---|
293 | |
---|
294 | #ifndef SEEK_END |
---|
295 | #define SEEK_END 2 |
---|
296 | #endif |
---|
297 | |
---|
298 | #ifndef SEEK_SET |
---|
299 | #define SEEK_SET 0 |
---|
300 | #endif |
---|
301 | |
---|
302 | #define HALT() m2_end(2) |
---|
303 | |
---|
304 | #define memcpy4 memcpy |
---|
305 | |
---|
306 | /* define OLD_RES for res/sres/mres(i,j,k) */ |
---|
307 | #undef OLD_RES |
---|
308 | |
---|
309 | /* the maximal ascii length of an int number + 1 = 11 for 32 bit int */ |
---|
310 | #define MAX_INT_LEN 11 |
---|
311 | #define MAX_INT_VAL 0x7fffffff |
---|
312 | extern int pShortOut; |
---|
313 | |
---|
314 | #ifdef DO_PROFILE |
---|
315 | /* define to enable explicit profiling of some crucial inline |
---|
316 | * routines and defines */ |
---|
317 | #undef DO_DEEP_PROFILE |
---|
318 | #endif |
---|
319 | |
---|
320 | #define buildin_rand 1 |
---|
321 | |
---|
322 | /* define to enable assume */ |
---|
323 | #ifndef HAVE_ASSUME |
---|
324 | #undef HAVE_ASSUME |
---|
325 | #endif |
---|
326 | |
---|
327 | /* set to 0 to disable aso memory mamagent */ |
---|
328 | #ifndef HAVE_ASO |
---|
329 | #define HAVE_ASO 0 |
---|
330 | #endif |
---|
331 | #if defined(HAVE_ASO) && HAVE_ASO == 1 |
---|
332 | /* define to enable ASO debugging */ |
---|
333 | #undef ASO_DEBUG |
---|
334 | #endif |
---|
335 | |
---|
336 | /******************************************************************* |
---|
337 | * DEBUG OPTIONS |
---|
338 | * -- only significant for for compiling without -DNDEBUG |
---|
339 | * -- you better know what your are doing, if you touch this |
---|
340 | ******************************************************************/ |
---|
341 | #ifndef NDEBUG |
---|
342 | |
---|
343 | /* undefine to disable assume -- should normally be defined for NDEBUG */ |
---|
344 | #define HAVE_ASSUME |
---|
345 | |
---|
346 | /* undef MDEBUG to disable memory checks |
---|
347 | * |
---|
348 | * define MDEBUG to |
---|
349 | * -1 to enable MTRACK, but to skip memory checks |
---|
350 | * 0 to enable basic memory checks (at least on each alloc/free) |
---|
351 | * 1 for addtl. containment checks in free/alloc list for each memory check |
---|
352 | * 2 for addtl. checks of entire free/alloc list at each memory check |
---|
353 | * 3 for addtl. checks of all heaps at each memory check |
---|
354 | * NOTE: For MDEBUG > 1, it gets very slow |
---|
355 | * You can control MDEBUG at run-time by setting the value of the |
---|
356 | * variable mm_MDEBUG (defined in mmcheck.c) to the appropriate value. |
---|
357 | */ |
---|
358 | #define MDEBUG 0 |
---|
359 | |
---|
360 | /* undef HEAP_DEBUG to disable heap checks |
---|
361 | * |
---|
362 | * define HEAP_DEBUG to |
---|
363 | * 0 to enable basic heap addr checks (at least on each alloc/free) |
---|
364 | * 1 for addtl. containment checks in free/alloc list of heap |
---|
365 | * 2 for addtl. check of entire heap at each heap addr check |
---|
366 | * NOTE: For HEAP_DEBUG > 1 on, it gets very slow |
---|
367 | * You can control HEAP_DEBUG at run-time by setting the value of the |
---|
368 | * variable mm_HEAP_DEBUG (defined in mmheap.c) to the appropriate value. |
---|
369 | */ |
---|
370 | /* #define HEAP_DEBUG 0 */ |
---|
371 | |
---|
372 | /* define PAGE_DEBUG for page accesses -- never re-uses freed pages */ |
---|
373 | #ifndef PAGE_DEBUG |
---|
374 | #undef PAGE_DEBUG |
---|
375 | #endif |
---|
376 | |
---|
377 | /* undef PDEBUG to disable checks of polys |
---|
378 | * |
---|
379 | * define PDEBUG to |
---|
380 | * 0 for basic, explicitely requested tests |
---|
381 | * 1 for tests in pProcs |
---|
382 | * 2 for low-level tests (Exponent access, primitive monom operations) |
---|
383 | * NOTE: for PDEBUG > 1 it gets very slow |
---|
384 | * You can locally enable tests in pProcs by setting the |
---|
385 | * define at the beginning of pProcs.cc |
---|
386 | */ |
---|
387 | #define PDEBUG 0 |
---|
388 | |
---|
389 | /* undef KDEBUG for checck of data during std computations |
---|
390 | * |
---|
391 | * define KDEBUG to |
---|
392 | * 0 for basic tests |
---|
393 | * 1 for tests in kSpoly |
---|
394 | * NOTE: You can locally enable tests in kspoly by setting the |
---|
395 | * define at the beginning of kspoly.cc |
---|
396 | */ |
---|
397 | #define KDEBUG 0 |
---|
398 | |
---|
399 | /* define LDEBUG checking numbers, undefine otherwise */ |
---|
400 | #define LDEBUG |
---|
401 | /* define RDEBUG checking rings (together with TRACE=9) */ |
---|
402 | #define RDEBUG |
---|
403 | /* define TEST for non time critical tests, undefine otherwise */ |
---|
404 | #define TEST |
---|
405 | /* define MLIST for printing block of used memory on exit */ |
---|
406 | #define MLIST 1 |
---|
407 | |
---|
408 | #ifdef HAVE_MTRACK |
---|
409 | /* define MTRACK for allowing to keep track of Alloc/Free with a backtrace */ |
---|
410 | /* works only under linux/elf */ |
---|
411 | #define MTRACK |
---|
412 | /* define to enable stack storing of free calls, as well */ |
---|
413 | #undef MTRACK_FREE |
---|
414 | |
---|
415 | #endif /* !NDEBUG */ |
---|
416 | |
---|
417 | |
---|
418 | /* #define PAGE_TEST */ |
---|
419 | |
---|
420 | /* define YYDEBUG 1 for debugging bison texts, 0 otherwise */ |
---|
421 | #define YYDEBUG 1 |
---|
422 | |
---|
423 | /* Undefine to disable debugging of MP stuff */ |
---|
424 | #ifdef HAVE_MPSR |
---|
425 | #define MPSR_DEBUG |
---|
426 | #endif |
---|
427 | |
---|
428 | /* PDEBUG requires MDEBUG */ |
---|
429 | #ifdef PDEBUG |
---|
430 | #ifndef MDEBUG |
---|
431 | #define MDEBUG 0 |
---|
432 | #endif |
---|
433 | #endif |
---|
434 | |
---|
435 | #ifdef TEST |
---|
436 | #ifndef buildin_rand |
---|
437 | #define buildin_rand 1 |
---|
438 | #endif |
---|
439 | #endif |
---|
440 | |
---|
441 | /* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */ |
---|
442 | /* define SPECTRUM_IOSTREAM to use C++ iostream for error messages */ |
---|
443 | |
---|
444 | /* #define SPECTRUM_DEBUG */ |
---|
445 | /* #define SPECTRUM_PRINT */ |
---|
446 | #undef SPECTRUM_IOSTREAM |
---|
447 | |
---|
448 | #ifdef SPECTRUM_DEBUG |
---|
449 | #define MULTICNT_DEBUG |
---|
450 | #define GMPRAT_DEBUG |
---|
451 | #define KMATRIX_DEBUG |
---|
452 | #define SPLIST_DEBUG |
---|
453 | #define NPOLYGON_DEBUG |
---|
454 | #define SEMIC_DEBUG |
---|
455 | #endif |
---|
456 | |
---|
457 | #ifdef SPECTRUM_PRINT |
---|
458 | #define MULTICNT_PRINT |
---|
459 | #define GMPRAT_PRINT |
---|
460 | #define KMATRIX_PRINT |
---|
461 | #define SPLIST_PRINT |
---|
462 | #define NPOLYGON_PRINT |
---|
463 | #define SEMIC_PRINT |
---|
464 | #endif |
---|
465 | |
---|
466 | #ifdef SPECTRUM_IOSTREAM |
---|
467 | #define MULTICNT_IOSTREAM |
---|
468 | #define GMPRAT_IOSTREAM |
---|
469 | #define KMATRIX_IOSTREAM |
---|
470 | #define SPLIST_IOSTREAM |
---|
471 | #define NPOLYGON_IOSTREAM |
---|
472 | #define SEMIC_IOSTREAM |
---|
473 | #endif |
---|
474 | |
---|
475 | |
---|
476 | #else /* not NDEBUG **************************************************** */ |
---|
477 | |
---|
478 | /* define YYDEBUG 1 for debugging bison texts, 0 otherwise */ |
---|
479 | #define YYDEBUG 0 |
---|
480 | |
---|
481 | #endif /* not NDEBUG */ |
---|
482 | |
---|
483 | /* MLIST requires MDEBUG */ |
---|
484 | #ifdef MLIST |
---|
485 | #ifndef MDEBUG |
---|
486 | #define MDEBUG 0 |
---|
487 | #endif |
---|
488 | #endif |
---|
489 | |
---|
490 | /* MTRACK requires MDEBUG and MLIST*/ |
---|
491 | #ifdef MTRACK |
---|
492 | #ifndef MDEBUG |
---|
493 | #define MDEBUG -1 |
---|
494 | #endif |
---|
495 | #ifndef MLIST |
---|
496 | #define MLIST |
---|
497 | #endif |
---|
498 | #endif |
---|
499 | |
---|
500 | |
---|
501 | #ifdef HAVE_DYNAMIC_LOADING |
---|
502 | # define HAVE_NAMESPACES 1 |
---|
503 | #endif /* HAVE_DYNAMIC_LOADING */ |
---|
504 | #ifdef HAVE_NAMESPACES |
---|
505 | # undef USE_IILOCALRING |
---|
506 | #endif |
---|
507 | |
---|
508 | /******************************************************************* |
---|
509 | * |
---|
510 | * assume(x) -- a handy macro for assumptions |
---|
511 | * |
---|
512 | ******************************************************************/ |
---|
513 | |
---|
514 | #ifndef HAVE_ASSUME |
---|
515 | #define assume(x) ((void*) 0) |
---|
516 | #define r_assume(x) ((void*) 0) |
---|
517 | #else /* ! HAVE_ASSUME */ |
---|
518 | |
---|
519 | #ifdef __cplusplus |
---|
520 | extern "C" { |
---|
521 | #endif |
---|
522 | /* Set a breakpoint on this function */ |
---|
523 | extern void assume_violation(char* file, int line); |
---|
524 | #ifdef __cplusplus |
---|
525 | } |
---|
526 | #endif |
---|
527 | |
---|
528 | |
---|
529 | #define assume(x) _assume(x, __FILE__, __LINE__) |
---|
530 | #define r_assume(x) _r_assume(x, __FILE__, __LINE__) |
---|
531 | |
---|
532 | #define _assume(x, f, l) \ |
---|
533 | do \ |
---|
534 | { \ |
---|
535 | if (! (x)) \ |
---|
536 | { \ |
---|
537 | assume_violation(f, l); \ |
---|
538 | } \ |
---|
539 | } \ |
---|
540 | while (0) |
---|
541 | |
---|
542 | #define _r_assume(x, f, l) \ |
---|
543 | do \ |
---|
544 | { \ |
---|
545 | if (! (x)) \ |
---|
546 | { \ |
---|
547 | assume_violation(f, l); \ |
---|
548 | return 0; \ |
---|
549 | } \ |
---|
550 | } \ |
---|
551 | while (0) |
---|
552 | #endif /* HAVE_ASSUME */ |
---|
553 | |
---|
554 | #endif /* MOD2_H */ |
---|