Mercurial > vba-clojure
annotate src/win32/7zip/7z/CPP/Common/Defs.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
rev | line source |
---|---|
rlm@1 | 1 // Common/Defs.h |
rlm@1 | 2 |
rlm@1 | 3 #ifndef __COMMON_DEFS_H |
rlm@1 | 4 #define __COMMON_DEFS_H |
rlm@1 | 5 |
rlm@1 | 6 template <class T> inline T MyMin(T a, T b) |
rlm@1 | 7 { return a < b ? a : b; } |
rlm@1 | 8 template <class T> inline T MyMax(T a, T b) |
rlm@1 | 9 { return a > b ? a : b; } |
rlm@1 | 10 |
rlm@1 | 11 template <class T> inline int MyCompare(T a, T b) |
rlm@1 | 12 { return a < b ? -1 : (a == b ? 0 : 1); } |
rlm@1 | 13 |
rlm@1 | 14 inline int BoolToInt(bool value) |
rlm@1 | 15 { return (value ? 1: 0); } |
rlm@1 | 16 |
rlm@1 | 17 inline bool IntToBool(int value) |
rlm@1 | 18 { return (value != 0); } |
rlm@1 | 19 |
rlm@1 | 20 #endif |