pimp_base.h 1.12 KB
Newer Older
1
/* pimp_base.h -- Some base defines used in Pimpmobile
Erik Faye-Lund's avatar
Erik Faye-Lund committed
2
 * Copyright (C) 2005-2006 Jørn Nystad and Erik Faye-Lund
3
4
5
 * For conditions of distribution and use, see copyright notice in LICENSE.TXT
 */

6
7
8
#ifndef PIMP_BASE_H
#define PIMP_BASE_H

9
#ifndef _gba_types_h_
10
11
12
13
14
15
16
17
18
19
#ifndef PIMP_DONT_DECLARE_BASIC_TYPES
typedef   signed char      s8;
typedef unsigned char      u8;
typedef   signed short     s16;
typedef unsigned short     u16;
typedef   signed int       s32;
typedef unsigned int       u32;
#endif
typedef   signed long long s64;
typedef unsigned long long u64;
20
#endif
21
22
23
24

#include <stddef.h>
typedef size_t    pimp_size_t;
typedef ptrdiff_t pimp_rel_ptr;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#ifndef NULL
#define NULL ((void*)0)
#endif

#ifndef BOOL
#define BOOL int
#endif

#ifndef TRUE
#define TRUE ((BOOL)1)
#endif

#ifndef FALSE
#define FALSE ((BOOL)0)
#endif

42
43
44
45
46
47
48
49
50
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif

#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif

#ifndef INLINE
Erik Faye-Lund's avatar
Erik Faye-Lund committed
51
#define INLINE __inline
52
53
#endif

54
55
56
57
58
59
60
61
62
63
#ifndef UNIT_TESTING
#define STATIC static
#else
#define STATIC
#endif

#ifndef PURE
#define PURE __attribute__((pure))
#endif

64
#endif /* PIMP_BASE_H */