Debian Codegraph @

Source/7zip/Common/Defs.h

raw
1 /*
2 * Defs.h
3 *
4 * This file is a part of LZMA compression module for NSIS.
5 *
6 * Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
7 * Modifications Copyright (C) 2003-2026 Amir Szekely <[email protected]>
8 *
9 * Licensed under the Common Public License version 1.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 *
12 * Licence details can be found in the file COPYING.
13 *
14 * This software is provided 'as-is', without any express or implied
15 * warranty.
16 */
17
18 #ifndef __COMMON_DEFS_H
19 #define __COMMON_DEFS_H
20
21 template <class T> inline T MyMin(T a, T b)
22 { return a < b ? a : b; }
23 template <class T> inline T MyMax(T a, T b)
24 { return a > b ? a : b; }
25
26 template <class T> inline int MyCompare(T a, T b)
27 { return a < b ? -1 : (a == b ? 0 : 1); }
28
29 inline int BoolToInt(bool value)
30 { return (value ? 1: 0); }
31
32 inline bool IntToBool(int value)
33 { return (value != 0); }
34
35 #endif