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