1 | /* |
2 | * Legal Notice |
3 | * |
4 | * This document and associated source code (the "Work") is a part of a |
5 | * benchmark specification maintained by the TPC. |
6 | * |
7 | * The TPC reserves all right, title, and interest to the Work as provided |
8 | * under U.S. and international laws, including without limitation all patent |
9 | * and trademark rights therein. |
10 | * |
11 | * No Warranty |
12 | * |
13 | * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION |
14 | * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE |
15 | * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER |
16 | * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
17 | * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, |
18 | * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR |
19 | * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF |
20 | * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE. |
21 | * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, |
22 | * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT |
23 | * WITH REGARD TO THE WORK. |
24 | * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO |
25 | * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE |
26 | * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS |
27 | * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, |
28 | * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, |
29 | * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT |
30 | * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD |
31 | * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. |
32 | * |
33 | * Contributors |
34 | * - Doug Johnson, Matt Emmerton, Larry Loen, Chris Chan-Nui |
35 | */ |
36 | |
37 | /****************************************************************************** |
38 | * Description: This file contains mappings from platform specific |
39 | * data types to platform indepenent data types used |
40 | * throughout EGen. |
41 | ******************************************************************************/ |
42 | |
43 | #ifndef EGEN_STANDARD_TYPES_H |
44 | #define EGEN_STANDARD_TYPES_H |
45 | |
46 | //////////////////// |
47 | // Standard types // |
48 | //////////////////// |
49 | |
50 | // Define unsigned type for convenience |
51 | typedef unsigned int UINT; |
52 | |
53 | // This is a template that can be used for each |
54 | // platform type. |
55 | // |
56 | // #ifdef {platform flag} |
57 | // // Mapping for {platform} data types. |
58 | // typedef {platform type} INT8, *PINT8; |
59 | // typedef {platform type} INT16, *PINT16; |
60 | // typedef {platform type} INT32, *PINT32; |
61 | // typedef {platform type} INT64, *PINT64; |
62 | // |
63 | // typedef {platform type} UINT8, *PUINT8; |
64 | // typedef {platform type} UINT16, *PUINT16; |
65 | // typedef {platform type} UINT32, *PUINT32; |
66 | // typedef {platform type} UINT64, *PUINT64; |
67 | // #endif |
68 | // |
69 | |
70 | #define PRId64 "lld" |
71 | |
72 | #include <cstdint> |
73 | |
74 | typedef int8_t INT8, *PINT8; |
75 | typedef int16_t INT16, *PINT16; |
76 | typedef int32_t INT32, *PINT32; |
77 | typedef int64_t INT64, *PINT64; |
78 | |
79 | typedef uint8_t UINT8, *PUINT8; |
80 | typedef uint16_t UINT16, *PUINT16; |
81 | typedef uint32_t UINT32, *PUINT32; |
82 | typedef uint64_t UINT64, *PUINT64; |
83 | |
84 | ///////////////////////////////////////////// |
85 | // 64-bit integer printf format specifier // |
86 | ///////////////////////////////////////////// |
87 | // Assume everyone else is a flavor of Unix, has __unix defined, |
88 | // and the 64-bit integer printf specifier is defined in <inttypes.h> as PRId64 |
89 | |
90 | ///////////////////////////////////////////// |
91 | // integer constant suffixes // |
92 | ///////////////////////////////////////////// |
93 | #define INT64_CONST(x) INT64_C(x) |
94 | #define UINT64_CONST(x) UINT64_C(x) |
95 | |
96 | ///////////////////////////////////////////// |
97 | // mutex and thread types // |
98 | ///////////////////////////////////////////// |
99 | |
100 | #include <pthread.h> |
101 | |
102 | typedef pthread_t TThread; |
103 | typedef pthread_attr_t TThreadAttr; |
104 | typedef pthread_mutex_t TMutex; |
105 | |
106 | ////////////////////////////////////////////// |
107 | // Database dependant indicator value types // |
108 | ////////////////////////////////////////////// |
109 | |
110 | #if defined(DB2) |
111 | // |
112 | // Mapping for DB2 data types. |
113 | typedef UINT16 DB_INDICATOR; |
114 | // |
115 | #elif defined(MSSQL) |
116 | // |
117 | // Mapping for MSSQL data types. |
118 | typedef long DB_INDICATOR; |
119 | // |
120 | #elif defined(ORACLE) |
121 | // |
122 | // Mapping for Oracle data types. |
123 | typedef sb2 DB_INDICATOR; |
124 | // |
125 | #else |
126 | // |
127 | // Arbitrary default just so we can compile |
128 | typedef INT32 DB_INDICATOR; |
129 | #endif // ORACLE |
130 | |
131 | ///////////////////////////////////////////////////////// |
132 | // Identifier type for all integer primary key fields. // |
133 | // Corresponds to IDENT_T metatype in TPC-E spec. // |
134 | ///////////////////////////////////////////////////////// |
135 | typedef INT64 TIdent; |
136 | |
137 | ///////////////////////////////////////////////////////// |
138 | // Identifier type for all trade id primary key fields.// |
139 | // Corresponds to TRADE_T metatype in TPC-E spec. // |
140 | ///////////////////////////////////////////////////////// |
141 | typedef INT64 TTrade; |
142 | |
143 | #endif // #ifndef EGEN_STANDARD_TYPES_H |
144 | |