- Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathmy_inttypes.h
121 lines (98 loc) · 3.65 KB
/
my_inttypes.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
Copyright (c) 2016, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MY_INTTYPES_INCLUDED
#defineMY_INTTYPES_INCLUDED
/**
@file include/my_inttypes.h
Some integer typedefs for easier portability.
@deprecated Use <stdint.h> instead. Prefer int to sized types.
*/
#include"my_config.h"
#ifndef MYSQL_ABI_CHECK
#include<stddef.h>
#include<stdint.h>
#include<sys/types.h>
#endif
#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
#include<BaseTsd.h>
typedefunsignedintuint;
typedefunsignedshortushort;
#endif
#if !defined(HAVE_ULONG) && !defined(MYSQL_ABI_CHECK)
typedefunsignedlong ulong; /* Short for unsigned long */
#endif
typedefunsignedchar uchar; /* Short for unsigned char */
// Don't use these in new code; use [u]int64_t.
typedeflonglongint longlong;
typedefunsignedlonglongint ulonglong;
// Legacy typedefs. Prefer the standard intXX_t (or std::intXX_t) to these.
// Note that the Google C++ style guide says you should generally not use
// unsigned types unless you need defined wraparound semantics or store
// things like bitfields. Your default choice of type should be simply int.
typedefint8_t int8;
typedefuint8_t uint8;
typedefint16_t int16;
typedefuint16_t uint16;
typedefint32_t int32;
typedefuint32_t uint32;
typedefint64_t int64;
typedefuint64_t uint64;
typedefintptr_t intptr;
typedef ulonglong my_off_t;
#defineMY_FILEPOS_ERROR (~(my_off_t)0)
#defineINT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
#defineINT_MAX640x7FFFFFFFFFFFFFFFLL
#defineINT_MIN32 (~0x7FFFFFFFL)
#defineINT_MAX320x7FFFFFFFL
#defineUINT_MAX320xFFFFFFFFL
#defineINT_MIN24 (~0x007FFFFF)
#defineINT_MAX240x007FFFFF
#defineUINT_MAX240x00FFFFFF
#defineINT_MIN16 (~0x7FFF)
#defineINT_MAX160x7FFF
#defineUINT_MAX160xFFFF
#defineINT_MIN8 (~0x7F)
#defineINT_MAX80x7F
#defineUINT_MAX80xFF
#ifndef SIZE_T_MAX
#defineSIZE_T_MAX (~((size_t)0))
#endif
typedefint myf; /* Type of MyFlags in my_funcs */
/* Macros for converting *constants* to the right type */
#defineMYF(v) (myf)(v)
/* Length of decimal number represented by INT32. */
#defineMY_INT32_NUM_DECIMAL_DIGITS11U
/* Length of decimal number represented by INT64. */
#defineMY_INT64_NUM_DECIMAL_DIGITS21U
#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
#ifndef SSIZE_T_DEFINED
/* krb5/win-mac.h has a conflicting typedef */
#defineSSIZE_T_DEFINED1
typedef SSIZE_T ssize_t;
#endif
#endif
/*
This doesn't really belong here, but it was the only reasonable place
at the time.
*/
#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
typedefintsigset_t;
#endif
#endif// MY_INTTYPES_INCLUDED