blob: 7ca9d76bcf92f72d2694a9e49d49ec830a7d9b66 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _STDINT_H
2#define _STDINT_H
3
4#define __NEED_int8_t
5#define __NEED_int16_t
6#define __NEED_int32_t
7#define __NEED_int64_t
8
9#define __NEED_uint8_t
10#define __NEED_uint16_t
11#define __NEED_uint32_t
12#define __NEED_uint64_t
13
Rich Felker0b44a032011-02-12 00:22:29 -050014#define __NEED_int_fast8_t
15#define __NEED_int_fast16_t
16#define __NEED_int_fast32_t
17#define __NEED_int_fast64_t
18
19#define __NEED_uint_fast8_t
20#define __NEED_uint_fast16_t
21#define __NEED_uint_fast32_t
22#define __NEED_uint_fast64_t
23
24#define __NEED_intptr_t
25#define __NEED_uintptr_t
Rich Felker0b44a032011-02-12 00:22:29 -050026
27#include <bits/alltypes.h>
28
Rich Felker28bde3b2011-04-11 10:38:00 -040029typedef int8_t int_least8_t;
30typedef int16_t int_least16_t;
31typedef int32_t int_least32_t;
32typedef int64_t int_least64_t;
33
34typedef uint8_t uint_least8_t;
35typedef uint16_t uint_least16_t;
36typedef uint32_t uint_least32_t;
37typedef uint64_t uint_least64_t;
38
Rich Felker43b2e9b2011-04-11 10:48:52 -040039typedef long long intmax_t;
40typedef unsigned long long uintmax_t;
41
Rich Felker0b44a032011-02-12 00:22:29 -050042#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
43
44#define INT8_MIN (-1-0x7f)
45#define INT16_MIN (-1-0x7fff)
46#define INT32_MIN (-1-0x7fffffff)
47#define INT64_MIN (-1-0x7fffffffffffffffLL)
48
49#define INT8_MAX (0x7f)
50#define INT16_MAX (0x7fff)
51#define INT32_MAX (0x7fffffff)
52#define INT64_MAX (0x7fffffffffffffffLL)
53
54#define UINT8_MAX (0xff)
55#define UINT16_MAX (0xffff)
56#define UINT32_MAX (0xffffffff)
57#define UINT64_MAX (0xffffffffffffffffULL)
58
59#define INT_LEAST8_MIN INT8_MIN
60#define INT_LEAST16_MIN INT16_MIN
61#define INT_LEAST32_MIN INT32_MIN
62#define INT_LEAST64_MIN INT64_MIN
63
64#define INT_LEAST8_MAX INT8_MAX
65#define INT_LEAST16_MAX INT16_MAX
66#define INT_LEAST32_MAX INT32_MAX
67#define INT_LEAST64_MAX INT64_MAX
68
69#define UINT_LEAST8_MAX UINT8_MAX
70#define UINT_LEAST16_MAX UINT16_MAX
71#define UINT_LEAST32_MAX UINT32_MAX
72#define UINT_LEAST64_MAX UINT64_MAX
73
Rich Felker0b44a032011-02-12 00:22:29 -050074#define INTMAX_MIN INT64_MIN
75#define INTMAX_MAX INT64_MAX
76#define UINTMAX_MAX UINT64_MAX
77
Rich Felker224c7a32011-09-19 17:39:51 -040078#define WINT_MIN INT32_MIN
79#define WINT_MAX INT32_MAX
80
81#include <bits/wchar.h>
Rich Felker0b44a032011-02-12 00:22:29 -050082#include <bits/stdint.h>
83
84#endif
85
86#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
87
Rich Felkera591e032012-02-07 12:08:27 -050088#define INT8_C(c) c
89#define INT16_C(c) c
Rich Felker0b44a032011-02-12 00:22:29 -050090#define INT32_C(c) c
91#define INT64_C(c) c ## LL
92
Rich Felker3d649462012-06-08 11:11:44 -040093#define UINT8_C(c) c
94#define UINT16_C(c) c
Rich Felker0b44a032011-02-12 00:22:29 -050095#define UINT32_C(c) c ## U
96#define UINT64_C(c) c ## ULL
97
98#define INTMAX_C(c) c ## LL
99#define UINTMAX_C(c) c ## ULL
100
101#endif
102
103#endif