#ifndef JED_H #define JED_H #ifndef MIN #define MIN(x,y) ((x)<(y)?(x):(y)) #endif #ifndef MAX #define MAX(x,y) ((x)>(y)?(x):(y)) #endif #define CLAMP(x,l,h) MAX(MIN((x),(h)),(l)) #define CSTR(var) const_cast(var.c_str()) #define DTAG {char df[1024]; strcpy(df,__FILE__); strcat(df," "); sprintf(df+6,"%3d: ",__LINE__); cout << df ;} #define DTAGO {char df[1024]; strcpy(df,__FILE__); strcat(df," "); sprintf(df+6,"%3d: ",__LINE__); printf(df) ;} #define COUT DTAG; cout #define PUTS DTAGO; puts #define PRINTF DTAGO; printf #endif