Search
lxdream.org :: lxdream/test/include/_ansi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/_ansi.h
changeset 185:6755a04c447f
author nkeynes
date Thu Aug 23 12:34:43 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Update generated files
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/include/_ansi.h Thu Aug 23 12:34:43 2007 +0000
1.3 @@ -0,0 +1,71 @@
1.4 +/* Provide support for both ANSI and non-ANSI environments. */
1.5 +
1.6 +/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
1.7 + relied upon to have it's intended meaning. Therefore we must use our own
1.8 + concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib
1.9 + sources!
1.10 +
1.11 + To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
1.12 + "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
1.13 + files aren't affected). */
1.14 +
1.15 +#ifndef _ANSIDECL_H_
1.16 +#define _ANSIDECL_H_
1.17 +
1.18 +#include <sys/config.h>
1.19 +
1.20 +/* First try to figure out whether we really are in an ANSI C environment. */
1.21 +/* FIXME: This probably needs some work. Perhaps sys/config.h can be
1.22 + prevailed upon to give us a clue. */
1.23 +
1.24 +#ifdef __STDC__
1.25 +#define _HAVE_STDC
1.26 +#endif
1.27 +
1.28 +#ifdef _HAVE_STDC
1.29 +#define _PTR void *
1.30 +#define _AND ,
1.31 +#define _NOARGS void
1.32 +#define _CONST const
1.33 +#define _VOLATILE volatile
1.34 +#define _SIGNED signed
1.35 +#define _DOTS , ...
1.36 +#define _VOID void
1.37 +#define _EXFUN(name, proto) name proto
1.38 +#define _DEFUN(name, arglist, args) name(args)
1.39 +#define _DEFUN_VOID(name) name(_NOARGS)
1.40 +#define _CAST_VOID (void)
1.41 +#ifndef _LONG_DOUBLE
1.42 +#define _LONG_DOUBLE long double
1.43 +#endif
1.44 +#ifndef _PARAMS
1.45 +#define _PARAMS(paramlist) paramlist
1.46 +#endif
1.47 +#else
1.48 +#define _PTR char *
1.49 +#define _AND ;
1.50 +#define _NOARGS
1.51 +#define _CONST
1.52 +#define _VOLATILE
1.53 +#define _SIGNED
1.54 +#define _DOTS
1.55 +#define _VOID void
1.56 +#define _EXFUN(name, proto) name()
1.57 +#define _DEFUN(name, arglist, args) name arglist args;
1.58 +#define _DEFUN_VOID(name) name()
1.59 +#define _CAST_VOID
1.60 +#define _LONG_DOUBLE double
1.61 +#ifndef _PARAMS
1.62 +#define _PARAMS(paramlist) ()
1.63 +#endif
1.64 +#endif
1.65 +
1.66 +/* Support gcc's __attribute__ facility. */
1.67 +
1.68 +#ifdef __GNUC__
1.69 +#define _ATTRIBUTE(attrs) __attribute__ (attrs)
1.70 +#else
1.71 +#define _ATTRIBUTE(attrs)
1.72 +#endif
1.73 +
1.74 +#endif /* _ANSIDECL_H_ */
.