Import libtu instead of using submodules
[notion/jeffpc.git] / libtu / types.h
blobb2bd6a79c88310c905a5de4508ff759c7756e33e
1 /*
2 * libtu/types.h
4 * Copyright (c) Tuomo Valkonen 1999-2002.
6 * You may distribute and modify this library under the terms of either
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
8 */
10 #ifndef LIBTU_TYPES_H
11 #define LIBTU_TYPES_H
13 #include <sys/types.h>
15 #ifndef TRUE
16 #define TRUE 1
17 #endif
19 #ifndef FALSE
20 #define FALSE 0
21 #endif
23 #ifndef NULL
24 #define NULL ((void*)0)
25 #endif
27 #ifndef LIBTU_TYPEDEF_UXXX
29 /* All systems seem to define these whichever way they want to
30 * despite -D_*_SOURCE etc. so there is no easy way to know whether
31 * they can be typedef'd or not. Unless you want to go through using
32 * autoconf or similar methods. ==> Just stick to #define. :-(
35 #ifndef uchar
36 #define uchar unsigned char
37 #endif
39 #ifndef ushort
40 #define ushort unsigned short
41 #endif
43 #ifndef uint
44 #define uint unsigned int
45 #endif
47 #ifndef ulong
48 #define ulong unsigned long
49 #endif
51 #else /* LIBTU_TYPEDEF_UXXX */
53 #ifndef uchar
54 typedef unsigned char uchar;
55 #endif
57 #ifndef ushort
58 typedef unsigned short ushort;
59 #endif
61 #ifndef uint
62 typedef unsigned int uint;
63 #endif
65 #ifndef ulong
66 typedef unsigned long ulong;
67 #endif
69 #endif /* LIBTU_TYPEDEF_UXXX */
72 #ifndef LIBTU_TYPEDEF_BOOL
74 #ifndef bool
75 #define bool int
76 #endif
78 #else /* LIBTU_TYPEDEF_BOOL */
80 #ifndef bool
81 typedef int bool;
82 #endif
84 #endif /* LIBTU_TYPEDEF_BOOL */
86 #endif /* LIBTU_TYPES_H */