/**** * * Standard C++ macros. * */ #ifndef stdmacrosIncluded #define stdmacrosIncluded #include #ifdef NOBOOL #define bool unsigned #define true 1 #define false 0 #define TRUE 1 #define FALSE 0 #endif #ifndef NULL #define NULL 0 #endif #ifndef null #define null 0 #endif #ifndef gcc_3_1 #define not ! #define and && #define or || #endif /* * Old exception handling. Define OLD_EXCEPTION_HANDLING if C++ compiler * cannot handle try,catch,throw properly. */ #ifdef OLD_EXCEPTION_HANDLING #define catch setjmp #define throw longjmp #define exception jmp_buf #endif #define streq(s1,s2) strcmp(s1,s2)==0 #define newstr(s) strcpy(new char[strlen(s)+1], s) #if SOLARIS && PLAINC #define bcopy(src, dest, size) memcpy(dest, src, size) #define bcmp(s1,s2,len) memcmp(s2,s1,len) #define log2(x) log(x)/log(2) #define exp10(x) pow(10.0,x) #define exp2(x) pow(2.0,x) #endif /* * Enable the following to have all files automaically use smart alloc. * #include "salloc++.h" * */ #endif