b311480e |
1 | // Copyright (c) 1998-1999 Matra Datavision |
a174a3c5 |
2 | // Copyright (c) 1999-2013 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
7fd59977 |
15 | #ifndef _Standard_TypeDef_HeaderFile |
16 | #define _Standard_TypeDef_HeaderFile |
17 | |
a174a3c5 |
18 | #include <cstddef> |
6c3e4c29 |
19 | #include <ctime> |
71c810df |
20 | |
21 | // VC9 does not have stdint.h |
22 | #if(defined(_MSC_VER) && (_MSC_VER < 1600)) |
23 | // old MSVC - hasn't stdint header |
24 | typedef unsigned __int8 uint8_t; |
25 | typedef unsigned __int16 uint16_t; |
26 | typedef unsigned __int32 uint32_t; |
27 | typedef unsigned __int64 uint64_t; |
28 | |
0a419c51 |
29 | typedef signed __int8 int8_t; |
30 | typedef signed __int16 int16_t; |
31 | typedef signed __int32 int32_t; |
32 | typedef signed __int64 int64_t; |
71c810df |
33 | #else |
34 | #include <stdint.h> |
35 | #endif |
a174a3c5 |
36 | |
64531d9c |
37 | #if(defined(_MSC_VER) && (_MSC_VER < 1800)) |
38 | // only Visual Studio 2013 (vc12) provides <cinttypes> header |
39 | // we do not defined all macros here - only used by OCCT framework |
56689b27 |
40 | #define PRId64 "I64d" |
41 | #define PRIu64 "I64u" |
42 | #define SCNd64 "I64d" |
43 | #define SCNu64 "I64u" |
64531d9c |
44 | #ifdef _WIN64 |
45 | #define PRIdPTR "I64d" |
46 | #define PRIuPTR "I64u" |
47 | #define SCNdPTR "I64d" |
48 | #define SCNuPTR "I64u" |
49 | #else |
50 | #define PRIdPTR "d" |
51 | #define PRIuPTR "u" |
52 | #define SCNdPTR "d" |
53 | #define SCNuPTR "u" |
54 | #endif |
55 | #else |
56 | // should be just <cinttypes> since C++11 |
57 | // however we use this code for compatibility with old C99 compilers |
58 | #ifndef __STDC_FORMAT_MACROS |
59 | #define __STDC_FORMAT_MACROS |
60 | #endif |
61 | #include <inttypes.h> |
62 | #endif |
63 | |
dde68833 |
64 | #define Standard_False false |
65 | #define Standard_True true |
7fd59977 |
66 | |
7fd59977 |
67 | #include <Standard_Macro.hxx> |
7fd59977 |
68 | |
64531d9c |
69 | typedef int Standard_Integer; |
70 | typedef double Standard_Real; |
dde68833 |
71 | typedef bool Standard_Boolean; |
64531d9c |
72 | typedef float Standard_ShortReal; |
73 | typedef char Standard_Character; |
64531d9c |
74 | typedef unsigned char Standard_Byte; |
75 | typedef void* Standard_Address; |
76 | typedef size_t Standard_Size; |
77 | typedef std::time_t Standard_Time; |
a174a3c5 |
78 | |
a174a3c5 |
79 | // Unicode primitives, char16_t, char32_t |
80 | typedef char Standard_Utf8Char; //!< signed UTF-8 char |
81 | typedef unsigned char Standard_Utf8UChar; //!< unsigned UTF-8 char |
71c810df |
82 | #if ((defined(__GNUC__) && !defined(__clang__) && ((__GNUC__ == 4 && __GNUC_MINOR__ <= 3) || __GNUC__ < 4)) || (defined(_MSC_VER) && (_MSC_VER < 1600))) |
83 | // compatibility with old GCC and MSVC compilers |
c885cfda |
84 | typedef uint16_t Standard_ExtCharacter; |
85 | typedef uint16_t Standard_Utf16Char; |
86 | typedef uint32_t Standard_Utf32Char; |
87 | #else |
88 | typedef char16_t Standard_ExtCharacter; |
89 | typedef char16_t Standard_Utf16Char; //!< UTF-16 char (always unsigned) |
90 | typedef char32_t Standard_Utf32Char; //!< UTF-32 char (always unsigned) |
91 | #endif |
a174a3c5 |
92 | typedef wchar_t Standard_WideChar; //!< wide char (unsigned UTF-16 on Windows platform and signed UTF-32 on Linux) |
93 | |
c885cfda |
94 | // |
95 | typedef const Standard_Character* Standard_CString; |
96 | typedef const Standard_ExtCharacter* Standard_ExtString; |
97 | |
64531d9c |
98 | #endif // _Standard_TypeDef_HeaderFile |