annotate th_types.h @ 182:d560371c85c0

Add checks for WIN64.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 31 Mar 2015 11:26:26 +0300
parents 9bc7f60f3013
children fa6113e556c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Type definations
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Programmed and designed by Matti 'ccr' Hamalainen
144
51eec969b07a Update copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 129
diff changeset
4 * (C) Copyright 2002-2015 Tecnic Software productions (TNSP)
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 *
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * Please read file 'COPYING' for information on license and distribution.
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 */
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 /* If your code uses "config.h", you need to #include
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 * it before including this header.
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 */
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #ifndef _TH_TYPES_H
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 #define _TH_TYPES_H
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
150
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
14 // Check for standard headers
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #ifdef HAVE_STDINT_H
150
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
16 # include <stdint.h>
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
17 # ifndef HAVE_INT_TYPES
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
18 # define HAVE_INT_TYPES 1
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
19 # endif
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
20 // Check for arch bitness
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
21 # if UINTPTR_MAX == 0xffffffff
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
22 # define TH_ARCH 32
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
23 # elif UINTPTR_MAX == 0xffffffffffffffff
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
24 # define TH_ARCH 64
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
25 # endif
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #ifdef HAVE_SYS_TYPES_H
150
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
29 # include <sys/types.h>
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
30 # ifndef HAVE_INT_TYPES
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
31 # define HAVE_INT_TYPES 1
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
32 # endif
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
33 #endif
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
34
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
35 #if !defined(TH_ARCH)
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
36 # if defined(__LP64__) || defined(_LP64)
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
37 # define TH_ARCH 64
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
38 # else
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
39 # define TH_ARCH 32
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
40 # endif
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
41 #endif
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
42
182
d560371c85c0 Add checks for WIN64.
Matti Hamalainen <ccr@tnsp.org>
parents: 150
diff changeset
43 #if !defined(TH_ARCH) && (defined(__WIN64) || defined(_WIN64))
d560371c85c0 Add checks for WIN64.
Matti Hamalainen <ccr@tnsp.org>
parents: 150
diff changeset
44 # define TH_ARCH 64
d560371c85c0 Add checks for WIN64.
Matti Hamalainen <ccr@tnsp.org>
parents: 150
diff changeset
45 #endif
150
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
46
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
47 #if !defined(TH_ARCH) && (defined(__WIN32) || defined(_WIN32))
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
48 # define TH_ARCH 32
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 #endif
150
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
50
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
51
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
52 // Do we have a valid arch?
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
53 // If so, set some printf specifiers
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
54 #if TH_ARCH == 32
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
55 # define TH_ARCH_32BIT 1
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
56 # define TH_PRIu32 "u"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
57 # define TH_PRId32 "d"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
58 # define TH_PRIx32 "x"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
59 # define TH_PRIu64 "llu"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
60 # define TH_PRId64 "lld"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
61 # define TH_PRIx64 "llx"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
62 # define TH_PRIu_SIZE_T "u"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
63 # define TH_PRId_SSIZE_T "d"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
64 # define TH_PRIx_SIZE_T "x"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
65 #elif TH_ARCH == 64
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
66 # define TH_ARCH_64BIT 1
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
67 # define TH_PRIu32 "u"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
68 # define TH_PRId32 "d"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
69 # define TH_PRIx32 "x"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
70 # define TH_PRIu64 "lu"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
71 # define TH_PRId64 "ld"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
72 # define TH_PRIx64 "lx"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
73 # define TH_PRIu_SIZE_T "lu"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
74 # define TH_PRId_SSIZE_T "ld"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
75 # define TH_PRIx_SIZE_T "lx"
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
76 #else
9bc7f60f3013 More portability stuff. :|
Matti Hamalainen <ccr@tnsp.org>
parents: 149
diff changeset
77 # error Could not determine architecture (32/64bit), please define TH_ARCH=32 or 64
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
80 // Shorthand types
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 typedef unsigned long int ulint_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 typedef signed long int lint_t;
149
6a0e9980b76b Mostly cosmetic changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
83 #ifndef HAVE_UINT_T // BOOST defines uint_t at least
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 typedef unsigned int uint_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 /* Default assumptions for these types should be ok for most 32bit platforms...
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 * feel free to define TH_TYPE_* if necessary to remedy
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 */
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 #ifdef TH_TYPE_I8
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
91 typedef unsigned TH_TYPE_I8 uint8_t; // 8 bits, unsigned
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
92 typedef signed TH_TYPE_I8 int8_t; // 8 bits, signed
149
6a0e9980b76b Mostly cosmetic changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
93 #elif !defined(HAVE_INT_TYPES)
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 typedef unsigned char uint8_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 typedef signed char int8_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 #ifdef TH_TYPE_I16
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
100 typedef unsigned TH_TYPE_I16 uint16_t; // 16 bits, unsigned == 2 BYTEs
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
101 typedef signed TH_TYPE_I16 int16_t; // 16 bits, signed
149
6a0e9980b76b Mostly cosmetic changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
102 #elif !defined(HAVE_INT_TYPES)
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 typedef unsigned short int uint16_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 typedef signed short int int16_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 #ifdef TH_TYPE_I32
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
108 typedef unsigned TH_TYPE_I32 uint32_t; // 32 bits, unsigned == 4 BYTES == 2 WORDs
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
109 typedef signed TH_TYPE_I32 int32_t; // 32 bits, signed
149
6a0e9980b76b Mostly cosmetic changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
110 #elif !defined(HAVE_INT_TYPES)
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 typedef unsigned int uint32_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 typedef signed int int32_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 #ifdef TH_TYPE_I64
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
116 typedef unsigned TH_TYPE_I64 uint64_t; // 64 bits, unsigned == 8 BYTES == 2 DWORDs
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
117 typedef signed TH_TYPE_I64 int64_t; // 64 bits, signed
149
6a0e9980b76b Mostly cosmetic changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
118 #elif !defined(HAVE_INT_TYPES)
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 typedef unsigned long long uint64_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 typedef signed long long int64_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 /* This is the character type used in all string-related routines of
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 * th_libs. Currently it is set to be equivalent of basetype "char",
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 * but under some platforms it may be necessary to use
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 * "unsigned char" instead.
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 *
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 * Also in future this type may be changed to hold 32-bit UNICODE
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 */
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 typedef char char_t;
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 /* Define a boolean type
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 */
12
83f7c71e4772 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
136 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL)
83f7c71e4772 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
137 typedef enum { FALSE = 0, TRUE = 1 } BOOL;
0
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 #ifndef BOOL
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 #ifdef bool
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 #define BOOL bool
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 #else
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 #define BOOL int
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 #endif
bd61a80a6c54 Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147
129
aa2d608fb3f3 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
148 #endif // _TH_TYPES_H