1 /** \file utils.h \brief Macros and definitions if not defined in the operation system
2  *
3  *  $Author: peltotal $ $Date: 2007/02/26 13:48:19 $ $Revision: 1.10 $
4  *
5  *  MAD-ALCLIB: Implementation of ALC/LCT protocols, Compact No-Code FEC,
6  *  Simple XOR FEC, Reed-Solomon FEC, and RLC Congestion Control protocol.
7  *  Copyright (c) 2003-2007 TUT - Tampere University of Technology
8  *  main authors/contacts: jani.peltotalo@tut.fi and sami.peltotalo@tut.fi
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  *
24  *  In addition, as a special exception, TUT - Tampere University of Technology
25  *  gives permission to link the code of this program with the OpenSSL library (or
26  *  with modified versions of OpenSSL that use the same license as OpenSSL), and
27  *  distribute linked combinations including the two. You must obey the GNU
28  *  General Public License in all respects for all of the code used other than
29  *  OpenSSL. If you modify this file, you may extend this exception to your version
30  *  of the file, but you are not obligated to do so. If you do not wish to do so,
31  *  delete this exception statement from your version.
32  */
33 
34 #ifndef _UTILS_H_
35 #define _UTILS_H_
36 
37 #include <stdlib.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #ifndef min
44 	/** A macro that returns the minimum of a and b if not defined in Operation System. */
45         #define min(a,b)        ((a) <= (b) ? (a) : (b))
46 #endif
47 
48 #ifndef max
49 	/** A macro that returns the maximum of a and b if not defined in Operation System. */
50         #define max(a,b)        ((a) >= (b) ? (a) : (b))
51 #endif
52 
53 #ifndef BOOL
54 	/** A type definition for BOOL if not defined in Operation System. */
55 	typedef int BOOL;
56 #endif
57 
58 #ifndef TRUE
59 	/** Define TRUE if not defined in Operation System. */
60 	#define TRUE 1
61 #endif
62 
63 #ifndef FALSE
64 	/** Define FALSE if not defined in Operation System. */
65 	#define FALSE 0
66 #endif
67 
68 #ifdef __cplusplus
69 }; //extern "C"
70 #endif
71 
72 
73 #endif
74 
75