rnd-20020323-2-src
[rocksndiamonds.git] / src / libgame / types.h
1 /***********************************************************
2 * Artsoft Retro-Game Library                               *
3 *----------------------------------------------------------*
4 * (c) 1994-2001 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * types.h                                                  *
12 ***********************************************************/
13
14 #ifndef TYPES_H
15 #define TYPES_H
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <sys/types.h>
20
21 typedef unsigned char boolean;
22 typedef unsigned char byte;
23
24 #ifndef FALSE
25 #define FALSE           0
26 #define TRUE            (!FALSE)
27 #endif
28
29 #ifndef MIN
30 #define MIN(a,b)        ((a) < (b) ? (a) : (b))
31 #endif
32
33 #ifndef MAX
34 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
35 #endif
36
37 #ifndef ABS
38 #define ABS(a)          ((a) < 0 ? -(a) : (a))
39 #endif
40
41 #ifndef SIGN
42 #define SIGN(a)         ((a) < 0 ? -1 : ((a)>0 ? 1 : 0))
43 #endif
44
45 #define SIZEOF_ARRAY(array, type)       (sizeof(array) / sizeof(type))
46 #define SIZEOF_ARRAY_INT(array)         SIZEOF_ARRAY(array, int)
47
48 #endif /* TYPES_H */