michael@0: // Common/Defs.h michael@0: michael@0: #ifndef __COMMON_DEFS_H michael@0: #define __COMMON_DEFS_H michael@0: michael@0: template inline T MyMin(T a, T b) michael@0: { return a < b ? a : b; } michael@0: template inline T MyMax(T a, T b) michael@0: { return a > b ? a : b; } michael@0: michael@0: template inline int MyCompare(T a, T b) michael@0: { return a < b ? -1 : (a == b ? 0 : 1); } michael@0: michael@0: inline int BoolToInt(bool value) michael@0: { return (value ? 1: 0); } michael@0: michael@0: inline bool IntToBool(int value) michael@0: { return (value != 0); } michael@0: michael@0: #endif