xref: /netbsd-src/sys/sys/common_ansi.h (revision 4ae77e2dce2473eb1f3b2644c3bf2930dad5d1c9)
1*4ae77e2dSmatt /*	$NetBSD: common_ansi.h,v 1.1 2014/08/19 07:27:31 matt Exp $	*/
2*4ae77e2dSmatt 
3*4ae77e2dSmatt /*-
4*4ae77e2dSmatt  * Copyright (c) 2014 The NetBSD Foundation, Inc.
5*4ae77e2dSmatt  * All rights reserved.
6*4ae77e2dSmatt  *
7*4ae77e2dSmatt  * This code is derived from software contributed to The NetBSD Foundation
8*4ae77e2dSmatt  * by Matt Thomas of 3am Software Foundry.
9*4ae77e2dSmatt  *
10*4ae77e2dSmatt  * Redistribution and use in source and binary forms, with or without
11*4ae77e2dSmatt  * modification, are permitted provided that the following conditions
12*4ae77e2dSmatt  * are met:
13*4ae77e2dSmatt  * 1. Redistributions of source code must retain the above copyright
14*4ae77e2dSmatt  *    notice, this list of conditions and the following disclaimer.
15*4ae77e2dSmatt  * 2. Redistributions in binary form must reproduce the above copyright
16*4ae77e2dSmatt  *    notice, this list of conditions and the following disclaimer in the
17*4ae77e2dSmatt  *    documentation and/or other materials provided with the distribution.
18*4ae77e2dSmatt  *
19*4ae77e2dSmatt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*4ae77e2dSmatt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*4ae77e2dSmatt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*4ae77e2dSmatt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*4ae77e2dSmatt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*4ae77e2dSmatt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*4ae77e2dSmatt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*4ae77e2dSmatt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*4ae77e2dSmatt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*4ae77e2dSmatt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*4ae77e2dSmatt  * POSSIBILITY OF SUCH DAMAGE.
30*4ae77e2dSmatt  */
31*4ae77e2dSmatt 
32*4ae77e2dSmatt #ifndef _SYS_COMMON_ANSI_H_
33*4ae77e2dSmatt #define _SYS_COMMON_ANSI_H_
34*4ae77e2dSmatt 
35*4ae77e2dSmatt #include <sys/cdefs.h>
36*4ae77e2dSmatt 
37*4ae77e2dSmatt #include <machine/int_types.h>
38*4ae77e2dSmatt 
39*4ae77e2dSmatt #if !defined(__PTRDIFF_TYPE__)
40*4ae77e2dSmatt #error __PTRDIFF_TYPE__ not present
41*4ae77e2dSmatt #endif
42*4ae77e2dSmatt 
43*4ae77e2dSmatt #if !defined(__SIZE_TYPE__)
44*4ae77e2dSmatt #error __SIZE_TYPE__ not present
45*4ae77e2dSmatt #endif
46*4ae77e2dSmatt 
47*4ae77e2dSmatt #if !defined(__WCHAR_TYPE__)
48*4ae77e2dSmatt #error __WCHAR_TYPE__ not present
49*4ae77e2dSmatt #endif
50*4ae77e2dSmatt 
51*4ae77e2dSmatt #if !defined(__WINT_TYPE__)
52*4ae77e2dSmatt #error __WINT_TYPE__ not present
53*4ae77e2dSmatt #endif
54*4ae77e2dSmatt 
55*4ae77e2dSmatt /*
56*4ae77e2dSmatt  * Types which are fundamental to the implementation and may appear in
57*4ae77e2dSmatt  * more than one standard header are defined here.  Standard headers
58*4ae77e2dSmatt  * then use:
59*4ae77e2dSmatt  *	#ifdef	_BSD_SIZE_T_
60*4ae77e2dSmatt  *	typedef	_BSD_SIZE_T_ size_t;
61*4ae77e2dSmatt  *	#undef	_BSD_SIZE_T_
62*4ae77e2dSmatt  *	#endif
63*4ae77e2dSmatt  */
64*4ae77e2dSmatt #define	_BSD_CLOCK_T_		unsigned int	/* clock() */
65*4ae77e2dSmatt #define	_BSD_PTRDIFF_T_		__PTRDIFF_TYPE__ /* ptr1 - ptr2 */
66*4ae77e2dSmatt #define	_BSD_SSIZE_T_		__PTRDIFF_TYPE__ /* byte count or error */
67*4ae77e2dSmatt #define	_BSD_SIZE_T_		__SIZE_TYPE__	/* sizeof() */
68*4ae77e2dSmatt #define	_BSD_TIME_T_		__int64_t	/* time() */
69*4ae77e2dSmatt #define	_BSD_CLOCKID_T_		int		/* clockid_t */
70*4ae77e2dSmatt #define	_BSD_TIMER_T_		int		/* timer_t */
71*4ae77e2dSmatt #define	_BSD_SUSECONDS_T_	int		/* suseconds_t */
72*4ae77e2dSmatt #define	_BSD_USECONDS_T_	unsigned int	/* useconds_t */
73*4ae77e2dSmatt #define	_BSD_WCHAR_T_		__WCHAR_TYPE__	/* wchar_t */
74*4ae77e2dSmatt #define	_BSD_WINT_T_		__WINT_TYPE__	/* wint_t */
75*4ae77e2dSmatt 
76*4ae77e2dSmatt #endif	/* _SYS_COMMON_ANSI_H_ */
77