2000-02-18 03:39:52 +08:00
|
|
|
/* Provide support for both ANSI and non-ANSI environments. */
|
|
|
|
|
|
|
|
/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
|
|
|
|
relied upon to have it's intended meaning. Therefore we must use our own
|
|
|
|
concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib
|
|
|
|
sources!
|
|
|
|
|
|
|
|
To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
|
|
|
|
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
|
|
|
|
files aren't affected). */
|
|
|
|
|
|
|
|
#ifndef _ANSIDECL_H_
|
|
|
|
#define _ANSIDECL_H_
|
|
|
|
|
2002-08-28 04:27:35 +08:00
|
|
|
#include <newlib.h>
|
2000-02-18 03:39:52 +08:00
|
|
|
#include <sys/config.h>
|
|
|
|
|
|
|
|
/* First try to figure out whether we really are in an ANSI C environment. */
|
|
|
|
/* FIXME: This probably needs some work. Perhaps sys/config.h can be
|
|
|
|
prevailed upon to give us a clue. */
|
|
|
|
|
|
|
|
#ifdef __STDC__
|
|
|
|
#define _HAVE_STDC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _HAVE_STDC
|
|
|
|
#define _PTR void *
|
|
|
|
#define _AND ,
|
|
|
|
#define _NOARGS void
|
|
|
|
#define _CONST const
|
|
|
|
#define _VOLATILE volatile
|
|
|
|
#define _SIGNED signed
|
|
|
|
#define _DOTS , ...
|
|
|
|
#define _VOID void
|
2000-09-07 04:46:27 +08:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
#define _EXFUN(name, proto) __cdecl name proto
|
|
|
|
#define _EXPARM(name, proto) (* __cdecl name) proto
|
|
|
|
#else
|
2000-02-18 03:39:52 +08:00
|
|
|
#define _EXFUN(name, proto) name proto
|
2000-09-07 04:46:27 +08:00
|
|
|
#define _EXPARM(name, proto) (* name) proto
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
#define _DEFUN(name, arglist, args) name(args)
|
|
|
|
#define _DEFUN_VOID(name) name(_NOARGS)
|
|
|
|
#define _CAST_VOID (void)
|
|
|
|
#ifndef _LONG_DOUBLE
|
|
|
|
#define _LONG_DOUBLE long double
|
|
|
|
#endif
|
2007-12-19 Dave Korn <dave.korn@artimi.com>
Jeff Johnston <jjohnstn@redhhat.com>
* libc/include/_ansi.h: Add _LONG_LONG definition.
* libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl): Add
prototypes.
* libc/machine/i386/machine/fastmath.h: Add support for new i386
fast math versions of rint, lrint, and llrint family functions.
* libm/machine/i386/Makefile.am: Add new files.
* libm/machine/i386/Makefile.in: Regenerated.
* libm/machine/i386/f_llrint.c, libm/machine/i386/f_lrint.c,
libm/machine/i386/f_rint.c, libm/machine/i386/f_llrintf.c,
libm/machine/i386/f_lrintf.c, libm/machine/i386/f_rintf.c,
libm/machine/i386/f_llrintl.c, libm/machine/i386/f_lrintl.c,
libm/machine/i386/f_rintl.c: New files with fast math implementations.
2007-12-20 06:20:25 +08:00
|
|
|
#ifndef _LONG_LONG
|
|
|
|
#define _LONG_LONG long long
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
#ifndef _PARAMS
|
|
|
|
#define _PARAMS(paramlist) paramlist
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define _PTR char *
|
|
|
|
#define _AND ;
|
|
|
|
#define _NOARGS
|
|
|
|
#define _CONST
|
|
|
|
#define _VOLATILE
|
|
|
|
#define _SIGNED
|
|
|
|
#define _DOTS
|
|
|
|
#define _VOID void
|
|
|
|
#define _EXFUN(name, proto) name()
|
|
|
|
#define _DEFUN(name, arglist, args) name arglist args;
|
|
|
|
#define _DEFUN_VOID(name) name()
|
|
|
|
#define _CAST_VOID
|
|
|
|
#define _LONG_DOUBLE double
|
2007-12-19 Dave Korn <dave.korn@artimi.com>
Jeff Johnston <jjohnstn@redhhat.com>
* libc/include/_ansi.h: Add _LONG_LONG definition.
* libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl): Add
prototypes.
* libc/machine/i386/machine/fastmath.h: Add support for new i386
fast math versions of rint, lrint, and llrint family functions.
* libm/machine/i386/Makefile.am: Add new files.
* libm/machine/i386/Makefile.in: Regenerated.
* libm/machine/i386/f_llrint.c, libm/machine/i386/f_lrint.c,
libm/machine/i386/f_rint.c, libm/machine/i386/f_llrintf.c,
libm/machine/i386/f_lrintf.c, libm/machine/i386/f_rintf.c,
libm/machine/i386/f_llrintl.c, libm/machine/i386/f_lrintl.c,
libm/machine/i386/f_rintl.c: New files with fast math implementations.
2007-12-20 06:20:25 +08:00
|
|
|
#define _LONG_LONG long
|
2000-02-18 03:39:52 +08:00
|
|
|
#ifndef _PARAMS
|
|
|
|
#define _PARAMS(paramlist) ()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Support gcc's __attribute__ facility. */
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
|
|
|
|
#else
|
|
|
|
#define _ATTRIBUTE(attrs)
|
|
|
|
#endif
|
|
|
|
|
2002-06-28 07:58:38 +08:00
|
|
|
/* ISO C++. */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
|
|
|
|
#ifdef _HAVE_STD_CXX
|
|
|
|
#define _BEGIN_STD_C namespace std { extern "C" {
|
|
|
|
#define _END_STD_C } }
|
|
|
|
#else
|
|
|
|
#define _BEGIN_STD_C extern "C" {
|
|
|
|
#define _END_STD_C }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define _BEGIN_STD_C
|
|
|
|
#define _END_STD_C
|
|
|
|
#endif
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#endif /* _ANSIDECL_H_ */
|