/*preprocessor defines can be used to hide hardware dependencies*/ #ifdef MSDOS # define INT32 long # define INT16 int # define bigendian(i) (((i>>8)&0xff)|(i<<8)) /*mask FF is for sign extension*/ #else # define INT32 int # define INT16 short # define bigendian(i) (i) #endif /*or to hide repetitive snippets of code*/ #define swap(a, b) {int t; t=a; a=b; b=t;} #define max(a, b) (a>b? a: b)