Mercurial > hg > th-libs
annotate th_types.h @ 469:fe5b803ae449
Rename the global variable th_verbosityLevel to th_verbosity.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 04 Jun 2018 02:41:27 +0300 |
parents | 85fa3d333556 |
children | e4ce60239d16 |
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 |
454 | 4 * (C) Copyright 2002-2018 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 */ |
392 | 11 #ifndef TH_TYPES_H |
12 #define TH_TYPES_H 1 | |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
150 | 14 // Check for standard headers |
394
7df5991a0ed3
Handle HAVE_STDINT_H vs HAVE_SYS_TYPES_H somewhat more sanely.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
15 #if defined(HAVE_STDINT_H) |
150 | 16 # include <stdint.h> |
17 # ifndef HAVE_INT_TYPES | |
18 # define HAVE_INT_TYPES 1 | |
19 # endif | |
394
7df5991a0ed3
Handle HAVE_STDINT_H vs HAVE_SYS_TYPES_H somewhat more sanely.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
20 #elif defined(HAVE_SYS_TYPES_H) |
150 | 21 # include <sys/types.h> |
22 # ifndef HAVE_INT_TYPES | |
23 # define HAVE_INT_TYPES 1 | |
24 # endif | |
25 #endif | |
26 | |
391 | 27 #ifdef HAVE_INTTYPES_H |
28 # include <inttypes.h> | |
29 #endif | |
30 | |
31 | |
32 // Check for arch bitness | |
33 #if UINTPTR_MAX == 0xffffffff | |
34 # define TH_ARCH 32 | |
35 #elif UINTPTR_MAX == 0xffffffffffffffff | |
36 # define TH_ARCH 64 | |
37 #endif | |
38 | |
39 | |
150 | 40 #if !defined(TH_ARCH) |
41 # if defined(__LP64__) || defined(_LP64) | |
42 # define TH_ARCH 64 | |
43 # else | |
44 # define TH_ARCH 32 | |
45 # endif | |
46 #endif | |
47 | |
182 | 48 #if !defined(TH_ARCH) && (defined(__WIN64) || defined(_WIN64)) |
49 # define TH_ARCH 64 | |
50 #endif | |
150 | 51 |
52 #if !defined(TH_ARCH) && (defined(__WIN32) || defined(_WIN32)) | |
53 # define TH_ARCH 32 | |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 #endif |
150 | 55 |
56 | |
57 // Do we have a valid arch? | |
398 | 58 // If so, set some printf specifiers and other useful things |
150 | 59 #if TH_ARCH == 32 |
60 # define TH_ARCH_32BIT 1 | |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
61 # ifndef HAVE_INTTYPES_H |
398 | 62 // If we don't have ISO C99 inttypes.h, define PRI* macros |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
63 # define PRIu32 "u" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
64 # define PRId32 "d" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
65 # define PRIx32 "x" |
396 | 66 # define PRIi32 "i" |
397 | 67 # define PRIo32 "o" |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
68 # define PRIu64 "llu" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
69 # define PRId64 "lld" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
70 # define PRIx64 "llx" |
396 | 71 # define PRIi64 "lli" |
397 | 72 # define PRIo64 "llo" |
400
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
73 typedef long long int intmax_t; |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
74 typedef unsigned long long int uintmax_t; |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
75 # endif |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
76 # define PRIu_SIZE_T "u" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
77 # define PRId_SSIZE_T "d" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
78 # define PRIx_SIZE_T "x" |
308
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
79 # ifndef TH_PTRSIZE |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
80 # define TH_PTRSIZE 32 |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
81 # endif |
400
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
82 # ifndef INTPTR_MIN |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
83 # define INTPTR_MIN (-0x7fffffffL - 1) |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
84 # define INTPTR_MAX ( 0x7fffffffL) |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
85 # define UINTPTR_MAX ( 0xffffffffUL) |
308
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
86 # endif |
150 | 87 #elif TH_ARCH == 64 |
88 # define TH_ARCH_64BIT 1 | |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
89 # ifndef HAVE_INTTYPES_H |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
90 # define PRIu32 "u" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
91 # define PRId32 "d" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
92 # define PRIx32 "x" |
396 | 93 # define PRIi32 "i" |
397 | 94 # define PRIo32 "o" |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
95 # define PRIu64 "lu" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
96 # define PRId64 "ld" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
97 # define PRIx64 "lx" |
396 | 98 # define PRIi64 "li" |
397 | 99 # define PRIo64 "lo" |
395
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
100 # endif |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
101 # define PRIu_SIZE_T "lu" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
102 # define PRId_SSIZE_T "ld" |
bffd3caf2d2c
Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*.
Matti Hamalainen <ccr@tnsp.org>
parents:
394
diff
changeset
|
103 # define PRIx_SIZE_T "lx" |
308
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
104 # ifndef TH_PTRSIZE |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
105 # define TH_PTRSIZE 64 |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
106 # endif |
400
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
107 # ifndef INTPTR_MIN |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
108 # define INTPTR_MIN (-0x7fffffffffffffffL - 1) |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
109 # define INTPTR_MAX ( 0x7fffffffffffffffL) |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
110 # define UINTPTR_MAX ( 0xffffffffffffffffUL) |
308
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
111 # endif |
150 | 112 #else |
113 # 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
|
114 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
115 |
400
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
116 |
129 | 117 // Shorthand types |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
118 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
|
119 typedef signed long int lint_t; |
149 | 120 #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
|
121 typedef unsigned int uint_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 #endif |
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 /* 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
|
125 * 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
|
126 */ |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
127 #ifdef TH_TYPE_I8 |
129 | 128 typedef unsigned TH_TYPE_I8 uint8_t; // 8 bits, unsigned |
129 typedef signed TH_TYPE_I8 int8_t; // 8 bits, signed | |
149 | 130 #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
|
131 typedef unsigned char uint8_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 typedef signed char int8_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 #ifdef TH_TYPE_I16 |
129 | 137 typedef unsigned TH_TYPE_I16 uint16_t; // 16 bits, unsigned == 2 BYTEs |
138 typedef signed TH_TYPE_I16 int16_t; // 16 bits, signed | |
149 | 139 #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
|
140 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
|
141 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
|
142 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 #ifdef TH_TYPE_I32 |
129 | 145 typedef unsigned TH_TYPE_I32 uint32_t; // 32 bits, unsigned == 4 BYTES == 2 WORDs |
146 typedef signed TH_TYPE_I32 int32_t; // 32 bits, signed | |
149 | 147 #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
|
148 typedef unsigned int uint32_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
149 typedef signed int int32_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 #ifdef TH_TYPE_I64 |
129 | 153 typedef unsigned TH_TYPE_I64 uint64_t; // 64 bits, unsigned == 8 BYTES == 2 DWORDs |
154 typedef signed TH_TYPE_I64 int64_t; // 64 bits, signed | |
149 | 155 #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
|
156 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
|
157 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
|
158 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
159 |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
160 |
400
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
161 #ifndef HAVE_INT_TYPES |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
162 #if TH_ARCH == 32 |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
163 typedef long long int intmax_t; |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
164 typedef unsigned long long int uintmax_t; |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
165 #elif TH_ARCH == 64 |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
166 typedef long int intmax_t; |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
167 typedef unsigned long int uintmax_t; |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
168 #endif |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
169 #endif |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
170 |
f7919a143fcb
Add some missing types and macros when we do not have inttypes.h or stdint.h
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
171 |
453
efd33accdc81
Break backwards compatibility by renaming BOOL, TRUE and FALSE to lowercase.
Matti Hamalainen <ccr@tnsp.org>
parents:
432
diff
changeset
|
172 /* Define a boolean type, if needed |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
173 */ |
457
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
174 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL) |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
175 typedef enum { FALSE = 0, TRUE = 1 } BOOL; |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
176 #endif |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
177 |
457
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
178 #ifndef BOOL |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
179 # ifdef bool |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
180 # define BOOL bool |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
181 # else |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
182 # define BOOL int |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
183 # endif |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
184 #endif |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
185 |
392 | 186 #endif // TH_TYPES_H |