1 /* 2 * This file is in the public domain. 3 * $FreeBSD: src/sys/sys/inttypes.h,v 1.2 1999/08/28 00:51:47 peter Exp $ 4 * 5 * Note: since portions of these header files can be included with various 6 * other combinations of defines, we cannot surround the whole header file 7 * with an #ifndef sequence. Elements are individually protected. 8 */ 9 10 #ifndef _SYS_STDINT_H_ 11 #define _SYS_STDINT_H_ 12 13 #include <sys/cdefs.h> 14 #include <machine/stdint.h> 15 16 /* 17 * wchar_t and rune_t have to be of the same type. rune_t is meant 18 * for internal use only. 19 * 20 * wchar_t, wint_t and rune_t are signed, to allow EOF (-1) to naturally 21 * assigned. 22 * 23 * ANSI specifies ``int'' as argument for the is*() and to*() routines. 24 * Keeping wchar_t and rune_t as ``int'' instead of the more natural 25 * ``long'' helps ANSI conformance. ISO 10646 will most likely end up 26 * as 31 bit standard and all supported architectures have 27 * sizeof(int) >= 4. Unless compiler has overridden it with -fshort-wchar. 28 */ 29 #ifndef __cplusplus 30 #if defined(__SIZEOF_WCHAR_T__) && __SIZEOF_WCHAR_T__ == 2 31 typedef unsigned short __wchar_t; 32 #else 33 typedef int __wchar_t; 34 #endif 35 #endif 36 #ifndef ___WINT_T_DECLARED 37 typedef int __wint_t; 38 #define ___WINT_T_DECLARED 39 #endif 40 #ifndef ___RUNE_T_DECLARED 41 typedef int __rune_t; 42 #define ___RUNE_T_DECLARED 43 #endif 44 45 /* 46 * mbstate_t is an opaque object to keep conversion state, during multibyte 47 * stream conversions. The content must not be referenced by user programs. 48 */ 49 typedef union { 50 __uint8_t __mbstate8[128]; 51 __int64_t __mbstateL; /* for alignment */ 52 } __mbstate_t; 53 54 typedef __int64_t __off_t; 55 typedef __int32_t __pid_t; 56 57 #endif /* SYS_STDINT_H */ 58