xref: /onnv-gate/usr/src/lib/libast/sparc/include/ast/ast_common.h (revision 12068:08a39a083754)
14887Schin /***********************************************************************
24887Schin *                                                                      *
34887Schin *               This software is part of the ast package               *
4*12068SRoger.Faulkner@Oracle.COM *          Copyright (c) 1985-2010 AT&T Intellectual Property          *
54887Schin *                      and is licensed under the                       *
64887Schin *                  Common Public License, Version 1.0                  *
78462SApril.Chin@Sun.COM *                    by AT&T Intellectual Property                     *
84887Schin *                                                                      *
94887Schin *                A copy of the License is available at                 *
104887Schin *            http://www.opensource.org/licenses/cpl1.0.txt             *
114887Schin *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
124887Schin *                                                                      *
134887Schin *              Information and Software Systems Research               *
144887Schin *                            AT&T Research                             *
154887Schin *                           Florham Park NJ                            *
164887Schin *                                                                      *
174887Schin *                 Glenn Fowler <gsf@research.att.com>                  *
184887Schin *                  David Korn <dgk@research.att.com>                   *
194887Schin *                   Phong Vo <kpv@research.att.com>                    *
204887Schin *                                                                      *
214887Schin ***********************************************************************/
22*12068SRoger.Faulkner@Oracle.COM /* : : generated from /home/gisburn/ksh93/ast_ksh_20100309/build_sparc_32bit/src/lib/libast/features/common by iffe version 2009-12-04 : : */
234887Schin #ifndef _AST_COMMON_H
244887Schin #define _AST_COMMON_H	1
254887Schin #define _sys_types	1	/* #include <sys/types.h> ok */
264887Schin #define _hdr_pthread	1	/* #include <pthread.h> ok */
274887Schin #define _hdr_stdarg	1	/* #include <stdarg.h> ok */
284887Schin #define _hdr_stddef	1	/* #include <stddef.h> ok */
294887Schin #define _hdr_stdint	1	/* #include <stdint.h> ok */
304887Schin #define _hdr_inttypes	1	/* #include <inttypes.h> ok */
314887Schin #define _hdr_unistd	1	/* #include <unistd.h> ok */
324887Schin #define _hdr_time	1	/* #include <time.h> ok */
334887Schin #define _sys_time	1	/* #include <sys/time.h> ok */
344887Schin #define _sys_times	1	/* #include <sys/times.h> ok */
354887Schin #define _hdr_stdlib	1	/* #include <stdlib.h> ok */
364887Schin #define _typ_long_double	1	/* long double is a type */
374887Schin #define _typ_size_t	1	/* size_t is a type */
384887Schin #define _typ_ssize_t	1	/* ssize_t is a type */
394887Schin #define _sys_stat	1	/* #include <sys/stat.h> ok */
404887Schin #define _sys_socket	1	/* #include <sys/socket.h> ok */
414887Schin #define _std_proto	1	/* standard C prototypes ok */
424887Schin #define _ptr_void	1	/* standard C void* ok */
434887Schin /* disable non-standard linux/gnu inlines */
444887Schin #ifdef __GNUC__
454887Schin #	undef	__OPTIMIZE_SIZE__
464887Schin #	define	__OPTIMIZE_SIZE__	1
474887Schin #endif
484887Schin 
494887Schin /* __STD_C indicates that the language is ANSI-C or C++ */
504887Schin #if !defined(__STD_C) && __STDC__
514887Schin #	define	__STD_C		1
524887Schin #endif
534887Schin #if !defined(__STD_C) && (__cplusplus || c_plusplus)
544887Schin #	define __STD_C		1
554887Schin #endif
564887Schin #if !defined(__STD_C) && _std_proto
574887Schin #	define __STD_C		1
584887Schin #endif
594887Schin #if !defined(__STD_C)
604887Schin #	define __STD_C		0
614887Schin #endif
624887Schin 
634887Schin /* extern symbols must be protected against C++ name mangling */
644887Schin #ifndef _BEGIN_EXTERNS_
654887Schin #	if __cplusplus || c_plusplus
664887Schin #		define _BEGIN_EXTERNS_	extern "C" {
674887Schin #		define _END_EXTERNS_	}
684887Schin #	else
694887Schin #		define _BEGIN_EXTERNS_
704887Schin #		define _END_EXTERNS_
714887Schin #	endif
724887Schin #endif
734887Schin 
744887Schin /* _ARG_ simplifies function prototyping among flavors of C */
754887Schin #ifndef _ARG_
764887Schin #	if __STD_C
774887Schin #		define _ARG_(x)	x
784887Schin #	else
794887Schin #		define _ARG_(x)	()
804887Schin #	endif
814887Schin #endif
824887Schin 
834887Schin /* _NIL_ simplifies defining nil pointers to a given type */
844887Schin #ifndef _NIL_
854887Schin #	define _NIL_(x)	((x)0)
864887Schin #endif
874887Schin 
884887Schin /* __INLINE__ is the inline keyword */
894887Schin #if !defined(__INLINE__) && defined(__cplusplus)
904887Schin #	define __INLINE__	inline
914887Schin #endif
924887Schin #if !defined(__INLINE__) && defined(_WIN32) && !defined(__GNUC__)
934887Schin #	define __INLINE__	__inline
944887Schin #endif
954887Schin 
964887Schin /* Void_t is defined so that Void_t* can address any type */
974887Schin #ifndef Void_t
984887Schin #	if __STD_C
994887Schin #		define Void_t		void
1004887Schin #	else
1014887Schin #		define Void_t		char
1024887Schin #	endif
1034887Schin #endif
1044887Schin 
1054887Schin /* windows variants and veneers */
1064887Schin #if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__)
1074887Schin #	define _WINIX		1
1084887Schin #endif
1094887Schin 
1104887Schin /* dynamic linked library external scope handling */
1114887Schin #ifdef __DYNAMIC__
1124887Schin #	undef	__DYNAMIC__
1134887Schin #	ifndef _DLL
1144887Schin #		define _DLL		1
1154887Schin #	endif
1164887Schin #endif
1174887Schin #if _dll_import
1184887Schin #	if _BLD_STATIC && !_BLD_DLL
1194887Schin #		undef	_DLL
1204887Schin #	else
1214887Schin #		if !_UWIN && !defined(_DLL)
1224887Schin #			define _DLL		1
1234887Schin #		endif
1244887Schin #	endif
1254887Schin #	if !defined(__EXPORT__) && _BLD_DLL
1264887Schin #		define __EXPORT__	__declspec(dllexport)
1274887Schin #	endif
1284887Schin #	if !defined(__IMPORT__) && ( _BLD_DLL || defined(_DLL) )
1294887Schin #		define __IMPORT__	__declspec(dllimport)
1304887Schin #	endif
1314887Schin #	if _BLD_DLL && _UWIN
1324887Schin #	define __DYNAMIC__(v)		(_ast_getdll()->_ast_ ## v)
1334887Schin #	endif
1344887Schin #endif
1354887Schin #if !defined(_astimport)
1364887Schin #	if defined(__IMPORT__) && defined(_DLL)
1374887Schin #		define _astimport	__IMPORT__
1384887Schin #	else
1394887Schin #		define _astimport	extern
1404887Schin #	endif
1414887Schin #endif
1424887Schin #if _dll_import && ( !_BLD_DLL || _WINIX && !_UWIN )
1434887Schin #	ifdef __STDC__
1444887Schin #	define __EXTERN__(T,obj)	extern T obj; T* _imp__ ## obj = &obj
1454887Schin #	define __DEFINE__(T,obj,val)	T obj = val; T* _imp__ ## obj = &obj
1464887Schin #	else
1474887Schin #	define __EXTERN__(T,obj)	extern T obj; T* _imp__/**/obj = &obj
1484887Schin #	define __DEFINE__(T,obj,val)	T obj = val; T* _imp__/**/obj = &obj
1494887Schin #	endif
1504887Schin #else
1514887Schin #	define __EXTERN__(T,obj)	extern T obj
1524887Schin #	define __DEFINE__(T,obj,val)	T obj = val
1534887Schin #endif
1544887Schin 
1554887Schin #define _ast_LL	1	/* LL numeric suffix supported */
1564887Schin #define _ast_int1_t		char
1574887Schin #define _ast_int2_t		short
1584887Schin #define _ast_int4_t		int
1594887Schin #define _ast_int8_t		long long
1604887Schin #define _ast_intmax_t		_ast_int8_t
1614887Schin #define _ast_intswap		0
1624887Schin 
1634887Schin #define _ast_flt4_t		float
1644887Schin #define _ast_flt8_t		double
1654887Schin #define _ast_flt16_t		long double
1664887Schin #define _ast_fltmax_t		_ast_flt16_t
1674887Schin #define _typ_int8_t	1	/* int8_t is a type */
1684887Schin #define _typ_uint8_t	1	/* uint8_t is a type */
1694887Schin #define _typ_int16_t	1	/* int16_t is a type */
1704887Schin #define _typ_uint16_t	1	/* uint16_t is a type */
1714887Schin #define _typ_int32_t	1	/* int32_t is a type */
1724887Schin #define _typ_uint32_t	1	/* uint32_t is a type */
1734887Schin #define _typ_int64_t	1	/* int64_t is a type */
1744887Schin #define _typ_uint64_t	1	/* uint64_t is a type */
1754887Schin #define _typ_intmax_t	1	/* intmax_t is a type */
1764887Schin #define _typ_uintmax_t	1	/* uintmax_t is a type */
1774887Schin 
1784887Schin #ifndef va_listref
1794887Schin #ifndef	va_start
1804887Schin #if __STD_C
1814887Schin #include <stdarg.h>
1824887Schin #else
1834887Schin #include <varargs.h>
1844887Schin #endif
1854887Schin #endif
18610898Sroland.mainz@nrubsig.org #define va_listref(p) (p)	/* pass va_list to varargs function */
18710898Sroland.mainz@nrubsig.org #define va_listval(p) (p)	/* retrieve va_list from va_arg(ap,va_listarg) */
18810898Sroland.mainz@nrubsig.org #define va_listarg va_list	/* va_arg() va_list type */
1894887Schin #endif
1904887Schin #ifndef _AST_STD_H
1914887Schin #	if __STD_C && _hdr_stddef
1924887Schin #	include	<stddef.h>
1934887Schin #	endif
1944887Schin #	if _sys_types
1954887Schin #	include	<sys/types.h>
1964887Schin #	endif
1974887Schin #	if _hdr_stdint
1984887Schin #	include	<stdint.h>
1994887Schin #	else
2004887Schin #		if _hdr_inttypes
2014887Schin #		include	<inttypes.h>
2024887Schin #		endif
2034887Schin #	endif
2044887Schin #endif
2054887Schin #if !_typ_size_t
2064887Schin #	define _typ_size_t	1
2074887Schin 	typedef int size_t;
2084887Schin #endif
2094887Schin #if !_typ_ssize_t
2104887Schin #	define _typ_ssize_t	1
2114887Schin 	typedef int ssize_t;
2124887Schin #endif
2134887Schin #ifndef _AST_STD_H
2144887Schin #	if !_def_map_ast
2154887Schin #		include <ast_map.h>
2164887Schin #	endif
2174887Schin #endif
2184887Schin 
2194887Schin #endif
220