SSBM Decomp
Loading...
Searching...
No Matches
limits.h
Go to the documentation of this file.
1#ifndef _STD_LIMITS_H
2#define _STD_LIMITS_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#define CHAR_BIT 8
9
10#define SCHAR_MIN (-0x7F - 1)
11#define SCHAR_MAX 0x7F
12#define UCHAR_MAX 0xFF
13
14#define CHAR_MIN 0
15#define CHAR_MAX SCHAR_MAX
16
17#define SHRT_MIN (-0x7FFF - 1)
18#define SHRT_MAX 0x7FFF
19#define USHRT_MAX 0xFFFF
20
21#define INT_MIN (-0x7FFFFFFF - 1)
22#define INT_MAX 0x7FFFFFFF
23#define UINT_MAX 0xFFFFFFFF
24
25#define LONG_MIN (-0x7FFFFFFFL - 1)
26#define LONG_MAX 0x7FFFFFFFL
27#define ULONG_MAX 0xFFFFFFFFUL
28
29#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL - 1)
30#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL
31#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL
32
33#ifdef __cplusplus
34}
35
36namespace std {
37 template <typename T> class numeric_limits {
38 public:
39 inline static T min();
40 inline static T max();
41 };
42
43 template <> class numeric_limits<char> {
44 public:
45 inline static char min()
46 {
47 return -0x80;
48 }
49 inline static char max()
50 {
51 return 0x7F;
52 }
53 };
54
55 template <> class numeric_limits<short> {
56 public:
57 inline static short min()
58 {
59 return -0x8000;
60 }
61 inline static short max()
62 {
63 return 0x7FFF;
64 }
65 };
66
67 template <> class numeric_limits<int> {
68 public:
69 inline static int min()
70 {
71 return -0x80000000;
72 }
73 inline static int max()
74 {
75 return 0x7FFFFFFF;
76 }
77 };
78
79 template <> class numeric_limits<long> {
80 public:
81 inline static long min()
82 {
83 return -0x80000000;
84 }
85 inline static long max()
86 {
87 return 0x7FFFFFFF;
88 }
89 };
90
91 template <> class numeric_limits<unsigned char> {
92 public:
93 inline static unsigned char min()
94 {
95 return 0x0;
96 }
97 inline static unsigned char max()
98 {
99 return 0xFF;
100 }
101 };
102
103 template <> class numeric_limits<unsigned short> {
104 public:
105 inline static unsigned short min()
106 {
107 return 0x0;
108 }
109 inline static unsigned short max()
110 {
111 return 0xFFFF;
112 }
113 };
114
115 template <> class numeric_limits<unsigned int> {
116 public:
117 inline static unsigned int min()
118 {
119 return 0x0;
120 }
121 inline static unsigned int max()
122 {
123 return 0xFFFFFFFF;
124 }
125 };
126
127 template <> class numeric_limits<unsigned long> {
128 public:
129 inline static unsigned long min()
130 {
131 return 0x0;
132 }
133 inline static unsigned long max()
134 {
135 return 0xFFFFFFFF;
136 }
137 };
138
139} // namespace std
140#endif
141#endif