41 #ifndef _MALOC_BASE_H_ 42 #define _MALOC_BASE_H_ 83 #if !defined(CLOCKS_PER_SEC) 84 # define CLOCKS_PER_SEC 60 118 #if defined(__cplusplus) 132 #define VPRIVATE static 141 #define VWARN1(file, lineno) (fprintf(stderr,"VWARN: ASSERTION FAILURE! filename %s, line %u\n", (file), (lineno)), 0) 142 #define VASSERT1(file, lineno) (fprintf(stderr,"VASSERT: ASSERTION FAILURE! filename %s, line %u\n", (file), (lineno)), exit(1), 0) 143 #define VASSERT2(file, lineno) (fprintf(stderr,"VASSERT: ASSERTION FAILURE! filename %s, line %u\n", (file), (lineno)), abort(), 0) 144 #define VASSERT3(file, lineno, ex) (fprintf(stderr,"VASSERT: ASSERTION FAILURE! filename %s, line %u, (%s)\n", (file), (lineno), (#ex)), abort(), 0) 146 #define VWARN(ex) ((void) ((ex) ? 0 : VWARN1(__FILE__, __LINE__))) 147 #define VASSERT(ex) ((void) ((ex) ? 0 : VASSERT3(__FILE__, __LINE__, ex))) 155 #define VJMPERR0(x) if (!(x)) goto VERROR0 156 #define VJMPERR1(x) if (!(x)) goto VERROR1 157 #define VJMPERR2(x) if (!(x)) goto VERROR2 158 #define VJMPERR3(x) if (!(x)) goto VERROR3 159 #define VJMPERR4(x) if (!(x)) goto VERROR4 160 #define VJMPERR5(x) if (!(x)) goto VERROR5 161 #define VJMPERR6(x) if (!(x)) goto VERROR6 162 #define VJMPERR7(x) if (!(x)) goto VERROR7 163 #define VJMPERR8(x) if (!(x)) goto VERROR8 164 #define VJMPERR9(x) if (!(x)) goto VERROR9 172 #define VPI 3.14159265358979323846 173 #define VLARGE 1.0e+9 174 #define VSMALL 1.0e-9 175 #define VPRTKEY 10000 178 #define VMAX_ARGNUM 50 179 #define VMAX_ARGLEN 1024 180 #define VMAX_BUFSIZE 8192 181 #define VMAX_OBJECTS 16777216 187 #define VSTDMODE 0600 189 #define VNULL_STRING "\0" 190 #define VBLANK_STRING " " 191 #define VNEWLINE_STRING "\n" 193 #define VNULL_SYMBOL '\0' 194 #define VBLANK_SYMBOL ' ' 195 #define VNEWLINE_SYMBOL '\n' 196 #define VRDIN_SYMBOL '<' 197 #define VRDOUT_SYMBOL '>' 198 #define VPIPE_SYMBOL '|' 199 #define VDELIM_SET " ><|&" 207 #define VABS(x) ((x) >= 0 ? (x) : -(x)) 208 #define VMIN2(x,y) ((x) <= (y) ? (x) : (y)) 209 #define VMAX2(x,y) ((x) >= (y) ? (x) : (y)) 210 #define VSIGN(x,y) ((y) >= 0 ? (VABS(x)) : (-VABS(x))) 212 #define VODD(x) ((x)&1) 213 #define VEVEN(x) (!((x)&1)) 214 #define VZERO(x) ((x)==0) 215 #define VPOS(x) ((x)>0) 216 #define VNEG(x) ((x)<0) 217 #define VEVENP(x) (VEVEN(x) && VPOS(x)) 218 #define VEVENN(x) (VEVEN(x) && VNEG(x)) 220 #define VSQRT(x) (sqrt(x)) 221 #define VSQR(x) ((x)*(x)) 222 #define VSIN(x) (sin(x)) 223 #define VCOS(x) (cos(x)) 224 #define VTAN(x) (tan(x)) 225 #define VASIN(x) (asin(x)) 226 #define VACOS(x) (acos(x)) 227 #define VATAN(x) (atan(x)) 228 #define VSINH(x) (sinh(x)) 229 #define VCOSH(x) (cosh(x)) 230 #define VTANH(x) (tanh(x)) 231 #define VEXP(x) (exp(x)) 232 #define VPOW(x,y) (pow(x,y)) 233 #define VRINT(x) ((int)(floor((x)+0.5))) 235 #define VRAND (rand()) 236 #define VRANDMAX (RAND_MAX) 245 # define VINLINE_MALOC