/* * Typical C macro file. */ #ifndef stdmacrosIncluded #define stdmacrosIncluded #include #include #ifndef OSX #include #endif #define true 1 #define false 0 #define null 0 #define TRUE 1 #define FALSE 0 #ifndef NULL #define NULL 0 #endif #ifndef gplusplus #define bool unsigned char #define and && #define or || #define not ! #endif /* #define eq == */ #define neq != #ifndef gplusplus #define catch setjmp #define throw longjmp #define exception jmp_buf #endif #define xif #define xthen ? #define xelse : #define streq(S1,S2) strcmp(S1,S2) == 0 #define newstralloc(s) NewString(s) #define stralloc(s) strcpy((char*) malloc(strlen(s)+1), s) #define new(t) (t*) calloc(1, sizeof(t)) #define newblock(t, size) (t*) calloc(size, sizeof(t)) #ifdef SOLARIS #define exp10(x) pow(10.0,x) #define exp2(x) pow(2.0,x) #define bcopy(s1,s2,len) memcpy(s2,s1,len) #define bcmp(s1,s2,len) memcmp(s2,s1,len) #ifndef log2 #define log2(x) log(x)/log(2) #endif #endif #endif