home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / source / rayce27s / macro.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-02  |  556 b   |  18 lines

  1. #define sqr(a)    ((a)*(a))
  2.  
  3. #define    ABS(a)        (((a) < 0) ? -(a) : (a))
  4. #define SGN(a)        (((a)<0) ? -1 : 1)
  5. #define ISZERO(x)    ((tmpdouble = (x)) > -EPSILON && (tmpdouble) < EPSILON)
  6. #define setcolor(a,rr,gg,bb) ((a).r = rr, (a).g = rr, (a).b = bb)
  7. #define    MIN(a, b)    ( (a) < (b) ? (a) : (b) )
  8. #define MAX(a, b)    ( (a) > (b) ? (a) : (b) )
  9.  
  10. #define where()        printf("%s %d\n", __FILE__, __LINE__);
  11.  
  12. #define ALLOC(a)    (a *) malloc(sizeof(a))
  13. #define CHECK_MEM(a,b)     {if (a == NULL)  alloc_err(b); }
  14.  
  15. #ifndef DEBUG            /* make assert() calls stop */
  16. #define NDEBUG
  17. #endif
  18.