Mercurial > hg > th-libs
annotate th_types.h @ 662:81714d54689c
Improve th_string.o depency chain checking.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 Jan 2020 07:44:44 +0200 |
parents | 6d99150a8f89 |
children | 284d5b789b7c |
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 |
553 | 4 * (C) Copyright 2002-2020 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. |
622
6d99150a8f89
Some more slight Doxygenisation.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
7 * |
6d99150a8f89
Some more slight Doxygenisation.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
8 * If your code uses "config.h", you need to #include |
0
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 */ |
622
6d99150a8f89
Some more slight Doxygenisation.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
11 /// @file |
6d99150a8f89
Some more slight Doxygenisation.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
12 /// @brief Various platform-specific type and macro definitions. |
392 | 13 #ifndef TH_TYPES_H |
14 #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
|
15 |
573
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
16 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
17 // Check for system type |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
18 #if defined(__WIN64) || defined(_WIN64) || defined(__WIN32) || defined(_WIN32) |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
19 # define TH_PLAT_WINDOWS 1 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
20 #elif defined(__DJGPP__) && __DJGPP__ >= 2 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
21 # define TH_PLAT_DOS 1 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
22 # undef __STRICT_ANSI__ |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
23 #else |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
24 # define TH_PLAT_UNIX 1 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
25 #endif |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
26 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
27 |
150 | 28 // Check for standard headers |
575
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
29 #if defined(HAVE_INTTYPES_H) |
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
30 # include <inttypes.h> |
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
31 # ifndef HAVE_STDINT_H |
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
32 # define HAVE_STDINT_H 1 |
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
33 # endif |
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
34 #elif defined(HAVE_STDINT_H) |
150 | 35 # include <stdint.h> |
394
7df5991a0ed3
Handle HAVE_STDINT_H vs HAVE_SYS_TYPES_H somewhat more sanely.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
36 #elif defined(HAVE_SYS_TYPES_H) |
150 | 37 # include <sys/types.h> |
38 #endif | |
39 | |
391 | 40 |
41 // Check for arch bitness | |
573
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
42 #if !defined(TH_ARCH) && (defined(__WIN64) || defined(_WIN64)) |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
43 # define TH_ARCH 64 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
44 #endif |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
45 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
46 #if !defined(TH_ARCH) && (defined(__WIN32) || defined(_WIN32)) |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
47 # define TH_ARCH 32 |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
48 #endif |
7c0aa6bf484a
Improve system bit-ness handling and target platform.
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
49 |
495 | 50 #if !defined(TH_ARCH) |
51 # if UINTPTR_MAX == 0xffffffff | |
52 # define TH_ARCH 32 | |
53 # elif UINTPTR_MAX == 0xffffffffffffffff | |
54 # define TH_ARCH 64 | |
55 # endif | |
391 | 56 #endif |
57 | |
58 | |
150 | 59 #if !defined(TH_ARCH) |
60 # if defined(__LP64__) || defined(_LP64) | |
61 # define TH_ARCH 64 | |
62 # else | |
63 # define TH_ARCH 32 | |
64 # endif | |
65 #endif | |
66 | |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
67 |
150 | 68 // Do we have a valid arch? |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
69 // If we don't have ISO C99 inttypes.h, define PRI* macros |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
70 #ifndef HAVE_INTTYPES_H |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
71 # if TH_ARCH == 32 |
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
|
72 # 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
|
73 # 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
|
74 # define PRIx32 "x" |
396 | 75 # define PRIi32 "i" |
397 | 76 # 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
|
77 # 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
|
78 # 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
|
79 # define PRIx64 "llx" |
396 | 80 # define PRIi64 "lli" |
397 | 81 # define PRIo64 "llo" |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
82 # elif TH_ARCH == 64 |
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
|
83 # 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
|
84 # 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
|
85 # define PRIx32 "x" |
396 | 86 # define PRIi32 "i" |
397 | 87 # 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
|
88 # 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
|
89 # 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
|
90 # define PRIx64 "lx" |
396 | 91 # define PRIi64 "li" |
397 | 92 # define PRIo64 "lo" |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
93 # else |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
94 # error Could not determine architecture (32/64bit), please define TH_ARCH=32 or 64 |
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 # endif |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
96 #endif |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
97 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
98 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
99 // Define some printf specifiers and other useful things |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
100 #if TH_ARCH == 32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
101 # define PRIu_SIZE_T PRIu32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
102 # define PRId_SSIZE_T PRId32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
103 # define PRIx_SIZE_T PRIx32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
104 # define PRIu_OFF_T PRIu32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
105 # define PRIx_OFF_T PRId32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
106 # define PRIX_OFF_T PRIx32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
107 # ifndef TH_PTRSIZE |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
108 # define TH_PTRSIZE 32 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
109 # endif |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
110 # ifndef INTPTR_MIN |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
111 # define INTPTR_MIN (-0x7fffffffL - 1) |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
112 # define INTPTR_MAX ( 0x7fffffffL) |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
113 # define UINTPTR_MAX ( 0xffffffffUL) |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
114 # endif |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
115 #elif TH_ARCH == 64 |
578
ac2947ac9ef8
Define PRI*_SIZE_T from PRIu32/64 based on platform, this is cleaner and
Matti Hamalainen <ccr@tnsp.org>
parents:
575
diff
changeset
|
116 # define PRIu_SIZE_T PRIu64 |
ac2947ac9ef8
Define PRI*_SIZE_T from PRIu32/64 based on platform, this is cleaner and
Matti Hamalainen <ccr@tnsp.org>
parents:
575
diff
changeset
|
117 # define PRId_SSIZE_T PRId64 |
ac2947ac9ef8
Define PRI*_SIZE_T from PRIu32/64 based on platform, this is cleaner and
Matti Hamalainen <ccr@tnsp.org>
parents:
575
diff
changeset
|
118 # define PRIx_SIZE_T PRIx64 |
579
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
119 # define PRIu_OFF_T PRIu64 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
120 # define PRIx_OFF_T PRId64 |
c054e5831dfb
Clean up the th_types.h header #ifdef mess slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
578
diff
changeset
|
121 # define PRIX_OFF_T PRIx64 |
308
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
122 # ifndef TH_PTRSIZE |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
123 # define TH_PTRSIZE 64 |
0078dc5f6260
Define TH_PTRSIZE and UINTPTR_MAX if not defined already.
Matti Hamalainen <ccr@tnsp.org>
parents:
307
diff
changeset
|
124 # 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
|
125 # 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
|
126 # 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
|
127 # 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
|
128 # 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
|
129 # endif |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
130 #endif |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
131 |
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
|
132 |
575
ebdfc1fe1c98
Fixes to the type definitions.
Matti Hamalainen <ccr@tnsp.org>
parents:
573
diff
changeset
|
133 /* Default assumptions for these types should be ok for most 32/64bit platforms... |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 */ |
582
8c516309037e
Check for !defined(HAVE_STDINT_H) && !defined(HAVE_SYS_TYPES_H) before
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
135 #if !defined(HAVE_STDINT_H) && !defined(HAVE_SYS_TYPES_H) |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 typedef unsigned char uint8_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
137 typedef signed char int8_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
138 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
|
139 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
|
140 typedef unsigned int uint32_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 typedef signed int int32_t; |
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
142 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
|
143 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
|
144 |
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
|
145 #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
|
146 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
|
147 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
|
148 #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
|
149 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
|
150 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
|
151 #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
|
152 #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
|
153 |
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
|
154 |
453
efd33accdc81
Break backwards compatibility by renaming BOOL, TRUE and FALSE to lowercase.
Matti Hamalainen <ccr@tnsp.org>
parents:
432
diff
changeset
|
155 /* 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
|
156 */ |
457
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
157 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL) |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
158 typedef enum { FALSE = 0, TRUE = 1 } BOOL; |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
159 #endif |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
160 |
457
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
161 #ifndef BOOL |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
162 # ifdef bool |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
163 # define BOOL bool |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
164 # else |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
165 # define BOOL int |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
166 # endif |
85fa3d333556
Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents:
456
diff
changeset
|
167 #endif |
0
bd61a80a6c54
Initial import into Mercurial repository. Discarding old cvs/svn history
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
168 |
392 | 169 #endif // TH_TYPES_H |