xref: /dragonfly/include/stdint.h (revision 763ffc12)
1e2565a42SMatthew Dillon /*
2e2565a42SMatthew Dillon  * Copyright (c) 2003 Matthew Dillon <dillon@backplane.com>
3e2565a42SMatthew Dillon  * All rights reserved.
4e2565a42SMatthew Dillon  *
5e2565a42SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
6e2565a42SMatthew Dillon  * modification, are permitted provided that the following conditions
7e2565a42SMatthew Dillon  * are met:
8e2565a42SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
9e2565a42SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
10e2565a42SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
11e2565a42SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
12e2565a42SMatthew Dillon  *    documentation and/or other materials provided with the distribution.
13e2565a42SMatthew Dillon  *
14e2565a42SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15e2565a42SMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16e2565a42SMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17e2565a42SMatthew Dillon  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18e2565a42SMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19e2565a42SMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20e2565a42SMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21e2565a42SMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22e2565a42SMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23e2565a42SMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24e2565a42SMatthew Dillon  * SUCH DAMAGE.
25e2565a42SMatthew Dillon  */
26e2565a42SMatthew Dillon 
27e2565a42SMatthew Dillon #ifndef _STDINT_H_
28e2565a42SMatthew Dillon #define _STDINT_H_
29e2565a42SMatthew Dillon 
309d4f17d1Szrj #include <machine/stdint.h>
31e2565a42SMatthew Dillon 
32e2565a42SMatthew Dillon typedef __int8_t	int8_t;
33e2565a42SMatthew Dillon typedef __int16_t	int16_t;
34e2565a42SMatthew Dillon typedef __int32_t	int32_t;
35e2565a42SMatthew Dillon typedef __int64_t	int64_t;
36e2565a42SMatthew Dillon 
37*763ffc12SSascha Wildner #ifndef _UINT8_T_DECLARED
38e2565a42SMatthew Dillon typedef	__uint8_t	uint8_t;
39*763ffc12SSascha Wildner #define	_UINT8_T_DECLARED
40*763ffc12SSascha Wildner #endif
41*763ffc12SSascha Wildner #ifndef _UINT16_T_DECLARED
42e2565a42SMatthew Dillon typedef	__uint16_t	uint16_t;
43*763ffc12SSascha Wildner #define	_UINT16_T_DECLARED
44*763ffc12SSascha Wildner #endif
45*763ffc12SSascha Wildner #ifndef _UINT32_T_DECLARED
46e2565a42SMatthew Dillon typedef	__uint32_t	uint32_t;
47*763ffc12SSascha Wildner #define	_UINT32_T_DECLARED
48*763ffc12SSascha Wildner #endif
49*763ffc12SSascha Wildner #ifndef _UINT64_T_DECLARED
50e2565a42SMatthew Dillon typedef	__uint64_t	uint64_t;
51*763ffc12SSascha Wildner #define	_UINT64_T_DECLARED
52*763ffc12SSascha Wildner #endif
53e2565a42SMatthew Dillon 
549508afe9Szrj #ifndef _INTPTR_T_DECLARED
559508afe9Szrj #define _INTPTR_T_DECLARED
56e2565a42SMatthew Dillon typedef __intptr_t	intptr_t;
579508afe9Szrj #endif
58e2565a42SMatthew Dillon typedef __uintptr_t	uintptr_t;
59e2565a42SMatthew Dillon 
60e2565a42SMatthew Dillon typedef __intmax_t	intmax_t;
61e2565a42SMatthew Dillon typedef __uintmax_t	uintmax_t;
62e2565a42SMatthew Dillon 
63e2565a42SMatthew Dillon typedef __int_fast8_t		int_fast8_t;
64e2565a42SMatthew Dillon typedef __int_fast16_t		int_fast16_t;
65e2565a42SMatthew Dillon typedef __int_fast32_t		int_fast32_t;
66e2565a42SMatthew Dillon typedef __int_fast64_t		int_fast64_t;
67e2565a42SMatthew Dillon typedef __int_least8_t		int_least8_t;
68e2565a42SMatthew Dillon typedef __int_least16_t		int_least16_t;
69e2565a42SMatthew Dillon typedef __int_least32_t		int_least32_t;
70e2565a42SMatthew Dillon typedef __int_least64_t		int_least64_t;
71e2565a42SMatthew Dillon typedef __uint_fast8_t		uint_fast8_t;
72e2565a42SMatthew Dillon typedef __uint_fast16_t		uint_fast16_t;
73e2565a42SMatthew Dillon typedef __uint_fast32_t		uint_fast32_t;
74e2565a42SMatthew Dillon typedef __uint_fast64_t		uint_fast64_t;
75e2565a42SMatthew Dillon typedef __uint_least8_t		uint_least8_t;
76e2565a42SMatthew Dillon typedef __uint_least16_t	uint_least16_t;
77e2565a42SMatthew Dillon typedef __uint_least32_t	uint_least32_t;
78e2565a42SMatthew Dillon typedef __uint_least64_t	uint_least64_t;
79e2565a42SMatthew Dillon 
800d2a1deaSSimon Schubert #include <machine/int_const.h>
810d2a1deaSSimon Schubert #include <machine/int_limits.h>
82a44a78beSzrj #include <machine/wchar_limits.h>
83a44a78beSzrj 
84a44a78beSzrj /* Also possibly defined in <wchar.h> */
85a44a78beSzrj /* Limits of wchar_t. */
86a44a78beSzrj #ifndef WCHAR_MIN
87a44a78beSzrj #define	WCHAR_MIN	__WCHAR_MIN
88a44a78beSzrj #endif
89a44a78beSzrj #ifndef WCHAR_MAX
90a44a78beSzrj #define	WCHAR_MAX	__WCHAR_MAX
91a44a78beSzrj #endif
92a44a78beSzrj 
93a44a78beSzrj /* Limits of wint_t. */
94a44a78beSzrj #ifndef WINT_MIN
95a44a78beSzrj #define	WINT_MIN	__WINT_MIN
96a44a78beSzrj #endif
97a44a78beSzrj #ifndef WINT_MAX
98a44a78beSzrj #define	WINT_MAX	__WINT_MAX
99a44a78beSzrj #endif
1000d2a1deaSSimon Schubert 
101086b156cSSascha Wildner #if __EXT1_VISIBLE
102086b156cSSascha Wildner #ifndef RSIZE_MAX
103086b156cSSascha Wildner #define	RSIZE_MAX (SIZE_MAX >> 1)
104e2565a42SMatthew Dillon #endif
105086b156cSSascha Wildner #endif /* __EXT1_VISIBLE */
106e2565a42SMatthew Dillon 
107a44a78beSzrj #endif /* !_STDINT_H_ */
108