include/libtu/types.h

Wed, 19 Apr 2000 22:17:57 +0200

author
tuomov
date
Wed, 19 Apr 2000 22:17:57 +0200
changeset 6
f73065173121
parent 5
f878a9ffa3e0
child 8
c1994196683f
permissions
-rw-r--r--

trunk: changeset 9
Added rules.mk system.mk

5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
1 /*
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
2 * libtu/types.h
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
3 *
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2000.
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
5 *
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
6 * This file is distributed under the terms of the "Artistic License".
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
7 * See the included file LICENSE for details.
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
8 */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
9
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
10 #ifndef __LIBTU_TYPES_H
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
11 #define __LIBTU_TYPES_H
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
12
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
13 #include <sys/types.h>
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
14
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
15 #ifndef TRUE
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
16 #define TRUE 1
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
17 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
18
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
19 #ifndef FALSE
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
20 #define FALSE 0
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
21 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
22
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
23 #ifndef NULL
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
24 #define NULL ((void*)0)
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
25 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
26
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
27 #ifndef LIBTU_TYPEDEF_UXXX
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
28
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
29 /* All systems seem to define these whichever way they want to
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
30 * despite -D_*_SOURCE etc. so there is no easy way to know whether
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
31 * they can be typedef'd or not. Unless you want to go through using
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
32 * autoconf or similar methods. ==> Just stick to #define. :-(
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
33 */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
34
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
35 #ifndef uchar
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
36 #define uchar unsigned char
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
37 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
38 #ifndef ushort
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
39 #define ushort unsigned short
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
40 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
41 #ifndef uint
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
42 #define uint unsigned int
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
43 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
44 #ifndef ulong
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
45 #define ulong unsigned long
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
46 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
47
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
48 #else /* LIBTU_TYPEDEF_UXXX */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
49
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
50 #ifndef uchar
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
51 typedef unsigned char uchar;
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
52 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
53 #ifndef ushort
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
54 typedef unsigned short ushort;
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
55 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
56 #ifndef uint
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
57 typedef unsigned int uint;
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
58 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
59 #ifndef ulong
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
60 typedef unsigned long ulong;
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
61 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
62
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
63 #endif /* LIBTU_TYPEDEF_UXXX */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
64
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
65
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
66 #ifndef LIBTU_TYPEDEF_BOOL
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
67
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
68 #ifndef bool
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
69 #define bool int
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
70 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
71
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
72 #else /* LIBTU_TYPEDEF_BOOL */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
73
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
74 #ifndef bool
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
75 typedef int bool;
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
76 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
77
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
78 #endif /* LIBTU_TYPEDEF_BOOL */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
79
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
80 #endif /* __LIBTU_TYPES_H */

mercurial