]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/x86/limits.h
Add Socket Libraries.
[mirror_edk2.git] / StdLib / Include / x86 / limits.h
1 /** @file
2 Machine specific values for <limits.h>.
3
4 Within this file, the ^ character is used in comments to represent exponentiation.
5 Thus, 2^7 means "2 to the 7th power", NOT "2 XOR 7".
6
7 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available under
9 the terms and conditions of the BSD License that accompanies this distribution.
10 The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 **/
16 #ifndef _MACHINE_LIMITS_H
17 #define _MACHINE_LIMITS_H
18
19 /** Number of bits for smallest object that is not a bit-field (byte). **/
20 #define __CHAR_BIT 8
21
22 /** minimum value for an object of type signed char **/
23 #define __SCHAR_MIN -128 // -(2^7 - 1)
24
25 /** maximum value for an object of type signed char **/
26 #define __SCHAR_MAX +127 // 2^7 - 1
27
28 /** maximum value for an object of type unsigned char **/
29 #define __UCHAR_MAX 255 // 2^8 - 1
30
31 /** minimum value for an object of type short int **/
32 #define __SHRT_MIN -32768 // -(2^15 - 1)
33
34 /** maximum value for an object of type short int **/
35 #define __SHRT_MAX +32767 // 2^15 - 1
36
37 /** maximum value for an object of type unsigned short int **/
38 #define __USHRT_MAX 65535 // 2^16 - 1
39
40 /** maximum value for an object of type int **/
41 #define __INT_MAX +2147483647 // 2^31 - 1
42
43 /** minimum value for an object of type int **/
44 #define __INT_MIN (-2147483647 - 1) // -(2^31 - 1)
45
46 /** maximum value for an object of type unsigned int **/
47 #define __UINT_MAX 0xffffffff // 2^32 - 1
48
49 /** minimum value for an object of type long long int **/
50 //#define __LLONG_MIN -9223372036854775808LL // -(2^63 - 1)
51 //#define __LLONG_MIN ((-9223372036854775807LL)-1) // -(2^63 - 1)
52 #define __LLONG_MIN (-9223372036854775807LL - 1LL) // -(2^63 - 1)
53
54 /** maximum value for an object of type long long int **/
55 #define __LLONG_MAX 9223372036854775807LL // 2^63 - 1
56
57 /** maximum value for an object of type unsigned long long int **/
58 //#define __ULLONG_MAX 18446744073709551615ULL // 2^64 - 1
59 #define __ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL // 2^64 - 1
60
61 /* Intel extensions to <limits.h> for UEFI */
62 #define __SHORT_BIT 16
63 #define __WCHAR_BIT 16
64 #define __INT_BIT 32
65 #define __LONG_LONG_BIT 64
66
67 #endif /* _MACHINE_LIMITS_H */