xref: /titanic_52/usr/src/cmd/ast/libast/amd64/FEATURE/common (revision 906afcb89d0412cc073b95c2d701a804a8cdb62c)
1*906afcb8SAndy Fiddaman/* : : generated from contrib/ast/src/lib/libast/features/common by iffe version 2012-07-17 : : */
2*906afcb8SAndy Fiddaman#ifndef _AST_COMMON_H
3*906afcb8SAndy Fiddaman#define _AST_COMMON_H	1
4*906afcb8SAndy Fiddaman#define _sys_types	1	/* #include <sys/types.h> ok */
5*906afcb8SAndy Fiddaman#define _hdr_pthread	1	/* #include <pthread.h> ok */
6*906afcb8SAndy Fiddaman#define _hdr_stdarg	1	/* #include <stdarg.h> ok */
7*906afcb8SAndy Fiddaman#define _hdr_stddef	1	/* #include <stddef.h> ok */
8*906afcb8SAndy Fiddaman#define _hdr_stdint	1	/* #include <stdint.h> ok */
9*906afcb8SAndy Fiddaman#define _hdr_inttypes	1	/* #include <inttypes.h> ok */
10*906afcb8SAndy Fiddaman#define _hdr_unistd	1	/* #include <unistd.h> ok */
11*906afcb8SAndy Fiddaman#define _hdr_time	1	/* #include <time.h> ok */
12*906afcb8SAndy Fiddaman#define _sys_time	1	/* #include <sys/time.h> ok */
13*906afcb8SAndy Fiddaman#define _sys_times	1	/* #include <sys/times.h> ok */
14*906afcb8SAndy Fiddaman#define _hdr_stdlib	1	/* #include <stdlib.h> ok */
15*906afcb8SAndy Fiddaman#define _typ_long_double	1	/* long double is a type */
16*906afcb8SAndy Fiddaman#define _typ_size_t	1	/* size_t is a type */
17*906afcb8SAndy Fiddaman#define _typ_ssize_t	1	/* ssize_t is a type */
18*906afcb8SAndy Fiddaman#define _hdr_stdio	1	/* #include <stdio.h> ok */
19*906afcb8SAndy Fiddaman#define _typ___va_list	1	/* __va_list is a type */
20*906afcb8SAndy Fiddaman#define _sys_stat	1	/* #include <sys/stat.h> ok */
21*906afcb8SAndy Fiddaman#define _sys_socket	1	/* #include <sys/socket.h> ok */
22*906afcb8SAndy Fiddaman#define _std_proto	1	/* standard C prototypes ok */
23*906afcb8SAndy Fiddaman#define _ptr_void	1	/* standard C void* ok */
24*906afcb8SAndy Fiddaman/* disable non-standard linux/gnu inlines */
25*906afcb8SAndy Fiddaman#ifdef __GNUC__
26*906afcb8SAndy Fiddaman#	undef	__OPTIMIZE_SIZE__
27*906afcb8SAndy Fiddaman#	define	__OPTIMIZE_SIZE__	1
28*906afcb8SAndy Fiddaman#endif
29*906afcb8SAndy Fiddaman
30*906afcb8SAndy Fiddaman/* __STD_C indicates that the language is ANSI-C or C++ */
31*906afcb8SAndy Fiddaman#if !defined(__STD_C) && __STDC__
32*906afcb8SAndy Fiddaman#	define	__STD_C		1
33*906afcb8SAndy Fiddaman#endif
34*906afcb8SAndy Fiddaman#if !defined(__STD_C) && (__cplusplus || c_plusplus)
35*906afcb8SAndy Fiddaman#	define __STD_C		1
36*906afcb8SAndy Fiddaman#endif
37*906afcb8SAndy Fiddaman#if !defined(__STD_C) && _std_proto
38*906afcb8SAndy Fiddaman#	define __STD_C		1
39*906afcb8SAndy Fiddaman#endif
40*906afcb8SAndy Fiddaman#if !defined(__STD_C)
41*906afcb8SAndy Fiddaman#	define __STD_C		0
42*906afcb8SAndy Fiddaman#endif
43*906afcb8SAndy Fiddaman
44*906afcb8SAndy Fiddaman/* extern symbols must be protected against C++ name mangling */
45*906afcb8SAndy Fiddaman#ifndef _BEGIN_EXTERNS_
46*906afcb8SAndy Fiddaman#	if __cplusplus || c_plusplus
47*906afcb8SAndy Fiddaman#		define _BEGIN_EXTERNS_	extern "C" {
48*906afcb8SAndy Fiddaman#		define _END_EXTERNS_	}
49*906afcb8SAndy Fiddaman#	else
50*906afcb8SAndy Fiddaman#		define _BEGIN_EXTERNS_
51*906afcb8SAndy Fiddaman#		define _END_EXTERNS_
52*906afcb8SAndy Fiddaman#	endif
53*906afcb8SAndy Fiddaman#endif
54*906afcb8SAndy Fiddaman
55*906afcb8SAndy Fiddaman/* _ARG_ simplifies function prototyping among flavors of C */
56*906afcb8SAndy Fiddaman#ifndef _ARG_
57*906afcb8SAndy Fiddaman#	if __STD_C
58*906afcb8SAndy Fiddaman#		define _ARG_(x)	x
59*906afcb8SAndy Fiddaman#	else
60*906afcb8SAndy Fiddaman#		define _ARG_(x)	()
61*906afcb8SAndy Fiddaman#	endif
62*906afcb8SAndy Fiddaman#endif
63*906afcb8SAndy Fiddaman
64*906afcb8SAndy Fiddaman/* _NIL_ simplifies defining nil pointers to a given type */
65*906afcb8SAndy Fiddaman#ifndef _NIL_
66*906afcb8SAndy Fiddaman#	define _NIL_(x)	((x)0)
67*906afcb8SAndy Fiddaman#endif
68*906afcb8SAndy Fiddaman
69*906afcb8SAndy Fiddaman/* __INLINE__, if defined, is the inline keyword */
70*906afcb8SAndy Fiddaman#if !defined(__INLINE__) && defined(__cplusplus)
71*906afcb8SAndy Fiddaman#	define __INLINE__	inline
72*906afcb8SAndy Fiddaman#endif
73*906afcb8SAndy Fiddaman#if !defined(__INLINE__) && defined(_WIN32) && !defined(__GNUC__)
74*906afcb8SAndy Fiddaman#	define __INLINE__	__inline
75*906afcb8SAndy Fiddaman#endif
76*906afcb8SAndy Fiddaman
77*906afcb8SAndy Fiddaman/* Void_t is defined so that Void_t* can address any type */
78*906afcb8SAndy Fiddaman#ifndef Void_t
79*906afcb8SAndy Fiddaman#	if __STD_C
80*906afcb8SAndy Fiddaman#		define Void_t		void
81*906afcb8SAndy Fiddaman#	else
82*906afcb8SAndy Fiddaman#		define Void_t		char
83*906afcb8SAndy Fiddaman#	endif
84*906afcb8SAndy Fiddaman#endif
85*906afcb8SAndy Fiddaman
86*906afcb8SAndy Fiddaman/* windows variants and veneers */
87*906afcb8SAndy Fiddaman#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__)
88*906afcb8SAndy Fiddaman#	define _WINIX		1
89*906afcb8SAndy Fiddaman#endif
90*906afcb8SAndy Fiddaman
91*906afcb8SAndy Fiddaman/* dynamic linked library external scope handling */
92*906afcb8SAndy Fiddaman#ifdef __DYNAMIC__
93*906afcb8SAndy Fiddaman#	undef	__DYNAMIC__
94*906afcb8SAndy Fiddaman#	ifndef _DLL
95*906afcb8SAndy Fiddaman#		define _DLL		1
96*906afcb8SAndy Fiddaman#	endif
97*906afcb8SAndy Fiddaman#endif
98*906afcb8SAndy Fiddaman#if _dll_import
99*906afcb8SAndy Fiddaman#	if _BLD_STATIC && !_BLD_DLL
100*906afcb8SAndy Fiddaman#		undef	_DLL
101*906afcb8SAndy Fiddaman#	else
102*906afcb8SAndy Fiddaman#		if !_UWIN && !defined(_DLL)
103*906afcb8SAndy Fiddaman#			define _DLL		1
104*906afcb8SAndy Fiddaman#		endif
105*906afcb8SAndy Fiddaman#	endif
106*906afcb8SAndy Fiddaman#	if !defined(__EXPORT__) && _BLD_DLL
107*906afcb8SAndy Fiddaman#		define __EXPORT__	__declspec(dllexport)
108*906afcb8SAndy Fiddaman#	endif
109*906afcb8SAndy Fiddaman#	if !defined(__IMPORT__) && ( _BLD_DLL || defined(_DLL) )
110*906afcb8SAndy Fiddaman#		define __IMPORT__	__declspec(dllimport)
111*906afcb8SAndy Fiddaman#	endif
112*906afcb8SAndy Fiddaman#	if _BLD_DLL && _UWIN
113*906afcb8SAndy Fiddaman#	define __DYNAMIC__(v)		(_ast_getdll()->_ast_ ## v)
114*906afcb8SAndy Fiddaman#	endif
115*906afcb8SAndy Fiddaman#endif
116*906afcb8SAndy Fiddaman#if !defined(_astimport)
117*906afcb8SAndy Fiddaman#	if defined(__IMPORT__) && defined(_DLL)
118*906afcb8SAndy Fiddaman#		define _astimport	__IMPORT__
119*906afcb8SAndy Fiddaman#	else
120*906afcb8SAndy Fiddaman#		define _astimport	extern
121*906afcb8SAndy Fiddaman#	endif
122*906afcb8SAndy Fiddaman#endif
123*906afcb8SAndy Fiddaman#if _dll_import && ( !_BLD_DLL || _WINIX && !_UWIN )
124*906afcb8SAndy Fiddaman#	ifdef __STDC__
125*906afcb8SAndy Fiddaman#	define __EXTERN__(T,obj)	extern T obj; T* _imp__ ## obj = &obj
126*906afcb8SAndy Fiddaman#	define __DEFINE__(T,obj,val)	T obj = val; T* _imp__ ## obj = &obj
127*906afcb8SAndy Fiddaman#	else
128*906afcb8SAndy Fiddaman#	define __EXTERN__(T,obj)	extern T obj; T* _imp__/**/obj = &obj
129*906afcb8SAndy Fiddaman#	define __DEFINE__(T,obj,val)	T obj = val; T* _imp__/**/obj = &obj
130*906afcb8SAndy Fiddaman#	endif
131*906afcb8SAndy Fiddaman#else
132*906afcb8SAndy Fiddaman#	define __EXTERN__(T,obj)	extern T obj
133*906afcb8SAndy Fiddaman#	define __DEFINE__(T,obj,val)	T obj = val
134*906afcb8SAndy Fiddaman#endif
135*906afcb8SAndy Fiddaman
136*906afcb8SAndy Fiddaman#define _ast_LL	1	/* LL numeric suffix supported */
137*906afcb8SAndy Fiddaman#define _ast_int1_t		char
138*906afcb8SAndy Fiddaman#define _ast_int2_t		short
139*906afcb8SAndy Fiddaman#define _ast_int4_t		int
140*906afcb8SAndy Fiddaman#define _ast_int8_t		long
141*906afcb8SAndy Fiddaman#define _ast_intmax_t		_ast_int8_t
142*906afcb8SAndy Fiddaman#define _ast_intmax_long		1
143*906afcb8SAndy Fiddaman#define _ast_intswap		7
144*906afcb8SAndy Fiddaman
145*906afcb8SAndy Fiddaman#define _ast_sizeof_short	2	/* sizeof(short) */
146*906afcb8SAndy Fiddaman#define _ast_sizeof_int		4	/* sizeof(int) */
147*906afcb8SAndy Fiddaman#define _ast_sizeof_long	8	/* sizeof(long) */
148*906afcb8SAndy Fiddaman#define _ast_sizeof_size_t	8	/* sizeof(size_t) */
149*906afcb8SAndy Fiddaman#define _ast_sizeof_pointer	8	/* sizeof(pointer) */
150*906afcb8SAndy Fiddaman#define _ast_sizeof_float	4	/* sizeof(float) */
151*906afcb8SAndy Fiddaman#define _ast_sizeof_double	8	/* sizeof(double) */
152*906afcb8SAndy Fiddaman#define _ast_sizeof_long_double	16	/* sizeof(long_double) */
153*906afcb8SAndy Fiddaman
154*906afcb8SAndy Fiddaman#define _ast_flt4_t		float
155*906afcb8SAndy Fiddaman#define _ast_flt8_t		double
156*906afcb8SAndy Fiddaman#define _ast_flt16_t		long double
157*906afcb8SAndy Fiddaman#define _ast_fltmax_t		_ast_flt16_t
158*906afcb8SAndy Fiddaman#define _typ_int8_t	1	/* int8_t is a type */
159*906afcb8SAndy Fiddaman#define _typ_uint8_t	1	/* uint8_t is a type */
160*906afcb8SAndy Fiddaman#define _typ_int16_t	1	/* int16_t is a type */
161*906afcb8SAndy Fiddaman#define _typ_uint16_t	1	/* uint16_t is a type */
162*906afcb8SAndy Fiddaman#define _typ_int32_t	1	/* int32_t is a type */
163*906afcb8SAndy Fiddaman#define _typ_uint32_t	1	/* uint32_t is a type */
164*906afcb8SAndy Fiddaman#define _typ_int64_t	1	/* int64_t is a type */
165*906afcb8SAndy Fiddaman#define _typ_uint64_t	1	/* uint64_t is a type */
166*906afcb8SAndy Fiddaman#define _typ_intmax_t	1	/* intmax_t is a type */
167*906afcb8SAndy Fiddaman#define _typ_uintmax_t	1	/* uintmax_t is a type */
168*906afcb8SAndy Fiddaman#define _typ_uintptr_t	1	/* uintptr_t is a type */
169*906afcb8SAndy Fiddaman
170*906afcb8SAndy Fiddaman#ifndef va_listref
171*906afcb8SAndy Fiddaman#ifndef	va_start
172*906afcb8SAndy Fiddaman#if __STD_C
173*906afcb8SAndy Fiddaman#include <stdarg.h>
174*906afcb8SAndy Fiddaman#else
175*906afcb8SAndy Fiddaman#include <varargs.h>
176*906afcb8SAndy Fiddaman#endif
177*906afcb8SAndy Fiddaman#endif
178*906afcb8SAndy Fiddaman#define va_listref(p) (&(p))	/* pass va_list to varargs function */
179*906afcb8SAndy Fiddaman#define va_listval(p) (*(p))	/* retrieve va_list from va_arg(ap,va_listarg) */
180*906afcb8SAndy Fiddaman#define va_listarg va_list*	/* va_arg() va_list type */
181*906afcb8SAndy Fiddaman#endif
182*906afcb8SAndy Fiddaman#ifndef _AST_STD_H
183*906afcb8SAndy Fiddaman#	if __STD_C && _hdr_stddef
184*906afcb8SAndy Fiddaman#	include	<stddef.h>
185*906afcb8SAndy Fiddaman#	endif
186*906afcb8SAndy Fiddaman#	if _sys_types
187*906afcb8SAndy Fiddaman#	include	<sys/types.h>
188*906afcb8SAndy Fiddaman#	endif
189*906afcb8SAndy Fiddaman#	if _hdr_stdint
190*906afcb8SAndy Fiddaman#	include	<stdint.h>
191*906afcb8SAndy Fiddaman#	else
192*906afcb8SAndy Fiddaman#		if _hdr_inttypes
193*906afcb8SAndy Fiddaman#		include	<inttypes.h>
194*906afcb8SAndy Fiddaman#		endif
195*906afcb8SAndy Fiddaman#	endif
196*906afcb8SAndy Fiddaman#endif
197*906afcb8SAndy Fiddaman#if !_typ_size_t
198*906afcb8SAndy Fiddaman#	define _typ_size_t	1
199*906afcb8SAndy Fiddaman	typedef int size_t;
200*906afcb8SAndy Fiddaman#endif
201*906afcb8SAndy Fiddaman#if !_typ_ssize_t
202*906afcb8SAndy Fiddaman#	define _typ_ssize_t	1
203*906afcb8SAndy Fiddaman	typedef int ssize_t;
204*906afcb8SAndy Fiddaman#endif
205*906afcb8SAndy Fiddaman#ifndef _AST_STD_H
206*906afcb8SAndy Fiddaman#	define _def_map_ast	1
207*906afcb8SAndy Fiddaman#	if !_def_map_ast
208*906afcb8SAndy Fiddaman#		include <ast_map.h>
209*906afcb8SAndy Fiddaman#	endif
210*906afcb8SAndy Fiddaman#endif
211*906afcb8SAndy Fiddaman
212*906afcb8SAndy Fiddaman#endif
213