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