1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2013 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
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
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.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14 
15 #ifndef _Standard_TypeDef_HeaderFile
16 #define _Standard_TypeDef_HeaderFile
17 
18 #include <cstddef>
19 #include <ctime>
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 
29   typedef signed __int8   int8_t;
30   typedef signed __int16  int16_t;
31   typedef signed __int32  int32_t;
32   typedef signed __int64  int64_t;
33 #else
34   #include <stdint.h>
35 #endif
36 
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
40   #define PRIx64 "I64x"
41   #define PRIX64 "I64X"
42   #define PRId64 "I64d"
43   #define PRIu64 "I64u"
44   #define SCNd64 "I64d"
45   #define SCNu64 "I64u"
46   #ifdef _WIN64
47     #define PRIxPTR "I64x"
48     #define PRIXPTR "I64X"
49     #define PRIdPTR "I64d"
50     #define PRIuPTR "I64u"
51     #define SCNdPTR "I64d"
52     #define SCNuPTR "I64u"
53   #else
54     #define PRIxPTR "Ix"
55     #define PRIXPTR "IX"
56     #define PRIdPTR "d"
57     #define PRIuPTR "u"
58     #define SCNdPTR "d"
59     #define SCNuPTR "u"
60   #endif
61 #else
62   // should be just <cinttypes> since C++11
63   // however we use this code for compatibility with old C99 compilers
64   #ifndef __STDC_FORMAT_MACROS
65     #define __STDC_FORMAT_MACROS
66   #endif
67   #include <inttypes.h>
68 #endif
69 
70 #define Standard_False false
71 #define Standard_True  true
72 
73 #include <Standard_Macro.hxx>
74 
75 typedef int           Standard_Integer;
76 typedef double        Standard_Real;
77 typedef bool          Standard_Boolean;
78 typedef float         Standard_ShortReal;
79 typedef char          Standard_Character;
80 typedef unsigned char Standard_Byte;
81 typedef void*         Standard_Address;
82 typedef size_t        Standard_Size;
83 typedef std::time_t   Standard_Time;
84 
85 // Unicode primitives, char16_t, char32_t
86 typedef char          Standard_Utf8Char;     //!< signed   UTF-8 char
87 typedef unsigned char Standard_Utf8UChar;    //!< unsigned UTF-8 char
88 #if ((defined(__GNUC__) && !defined(__clang__) && ((__GNUC__ == 4 && __GNUC_MINOR__ <= 3) || __GNUC__ < 4)) || (defined(_MSC_VER) && (_MSC_VER < 1600)))
89 // compatibility with old GCC and MSVC compilers
90 typedef uint16_t      Standard_ExtCharacter;
91 typedef uint16_t      Standard_Utf16Char;
92 typedef uint32_t      Standard_Utf32Char;
93 #else
94 typedef char16_t      Standard_ExtCharacter;
95 typedef char16_t      Standard_Utf16Char;    //!< UTF-16 char (always unsigned)
96 typedef char32_t      Standard_Utf32Char;    //!< UTF-32 char (always unsigned)
97 #endif
98 typedef wchar_t       Standard_WideChar;     //!< wide char (unsigned UTF-16 on Windows platform and signed UTF-32 on Linux)
99 
100 //
101 typedef const Standard_Character*    Standard_CString;
102 typedef const Standard_ExtCharacter* Standard_ExtString;
103 
104 #endif // _Standard_TypeDef_HeaderFile
105