rnd-20020324-1-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 <stdarg.h>
20 #include <sys/types.h>
21
22 typedef unsigned char boolean;
23 typedef unsigned char byte;
24
25 #ifndef FALSE
26 #define FALSE           0
27 #define TRUE            (!FALSE)
28 #endif
29
30 #ifndef MIN
31 #define MIN(a,b)        ((a) < (b) ? (a) : (b))
32 #endif
33
34 #ifndef MAX
35 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
36 #endif
37
38 #ifndef ABS
39 #define ABS(a)          ((a) < 0 ? -(a) : (a))
40 #endif
41
42 #ifndef SIGN
43 #define SIGN(a)         ((a) < 0 ? -1 : ((a)>0 ? 1 : 0))
44 #endif
45
46 #define SIZEOF_ARRAY(array, type)       (sizeof(array) / sizeof(type))
47 #define SIZEOF_ARRAY_INT(array)         SIZEOF_ARRAY(array, int)
48
49 #endif /* TYPES_H */