other-licenses/7zstub/src/Common/Defs.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/Common/Defs.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +// Common/Defs.h
     1.5 +
     1.6 +#ifndef __COMMON_DEFS_H
     1.7 +#define __COMMON_DEFS_H
     1.8 +
     1.9 +template <class T> inline T MyMin(T a, T b)
    1.10 +  {  return a < b ? a : b; }
    1.11 +template <class T> inline T MyMax(T a, T b)
    1.12 +  {  return a > b ? a : b; }
    1.13 +
    1.14 +template <class T> inline int MyCompare(T a, T b)
    1.15 +  {  return a < b ? -1 : (a == b ? 0 : 1); }
    1.16 +
    1.17 +inline int BoolToInt(bool value)
    1.18 +  { return (value ? 1: 0); }
    1.19 +
    1.20 +inline bool IntToBool(int value)
    1.21 +  { return (value != 0); }
    1.22 +
    1.23 +#endif

mercurial