-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdtypes.h.in
More file actions
66 lines (57 loc) · 1.6 KB
/
stdtypes.h.in
File metadata and controls
66 lines (57 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef STDTYPES_H
#define STDTYPES_H
#include <stdio.h>
@int8_type@
@int16_type@
@int32_type@
@uint8_type@
@uint16_type@
@uint32_type@
#if defined (_MSC_VER)
#define LL_FORMAT "%I64d"
#define ULL_FORMAT "%I64u"
typedef __int64 int64;
typedef unsigned __int64 uint64;
#else
@int64_type@
@uint64_type@
#define LL_FORMAT "%lld"
#define ULL_FORMAT "%llu"
// Paul J stated that %qu was more "generic" than %llu, so it is used here.
//#define LL_FORMAT "%qd"
//#define ULL_FORMAT "%qu"
// Provide compatiblity with VC's _atoi64() function for non-VC compilers.
#if defined (__cplusplus) && !defined (__MINGW32__)
inline int64 _atoi64(const char *s)
{
int64 i;
sscanf(s, "%lld", &i);
return i;
}
#endif // __cplusplus && !__MINGW32__
#endif // ! defined (_MSC_VER)
// VC does not have this.
#if defined (__cplusplus)
inline uint64 _atou64(const char *s)
{
uint64 u;
sscanf(s, ULL_FORMAT, &u);
return u;
}
#endif // defined __cplusplus
#ifndef INT_MAX
#define INT_MAX INT32_MAX
#define UINT_MAX UINT32_MAX
#define LLONG_MAX INT64_MAX
#define ULLONG_MAX UINT64_MAX
#endif
#if defined (_MSC_VER)
// Remove these VC warning level 4 warnings
// C4514 unreferenced inline function has been removed
// C4511 copy constructor could not be generated (In our code that is 100% what we want, non-copyable objects)
// C4512 assignment operator could not be generated (ditto)
// C4127 conditional expression is constant (Triggered by code like: while(1) {}
// C4505 unreferenced local function has been removed (triggered by static functions in bmap.cxx)
#pragma warning (disable : 4514 4511 4512 4127 4505)
#endif
#endif