Search
lxdream.org :: lxdream/test/include/_ansi.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/_ansi.h
changeset 185:6755a04c447f
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
nkeynes@185
     1
/* Provide support for both ANSI and non-ANSI environments.  */
nkeynes@185
     2
nkeynes@185
     3
/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
nkeynes@185
     4
   relied upon to have it's intended meaning.  Therefore we must use our own
nkeynes@185
     5
   concoction: _HAVE_STDC.  Always use _HAVE_STDC instead of __STDC__ in newlib
nkeynes@185
     6
   sources!
nkeynes@185
     7
nkeynes@185
     8
   To get a strict ANSI C environment, define macro __STRICT_ANSI__.  This will
nkeynes@185
     9
   "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
nkeynes@185
    10
   files aren't affected).  */
nkeynes@185
    11
nkeynes@185
    12
#ifndef	_ANSIDECL_H_
nkeynes@185
    13
#define	_ANSIDECL_H_
nkeynes@185
    14
nkeynes@185
    15
#include <sys/config.h>
nkeynes@185
    16
nkeynes@185
    17
/* First try to figure out whether we really are in an ANSI C environment.  */
nkeynes@185
    18
/* FIXME: This probably needs some work.  Perhaps sys/config.h can be
nkeynes@185
    19
   prevailed upon to give us a clue.  */
nkeynes@185
    20
nkeynes@185
    21
#ifdef __STDC__
nkeynes@185
    22
#define _HAVE_STDC
nkeynes@185
    23
#endif
nkeynes@185
    24
nkeynes@185
    25
#ifdef _HAVE_STDC
nkeynes@185
    26
#define	_PTR		void *
nkeynes@185
    27
#define	_AND		,
nkeynes@185
    28
#define	_NOARGS		void
nkeynes@185
    29
#define	_CONST		const
nkeynes@185
    30
#define	_VOLATILE	volatile
nkeynes@185
    31
#define	_SIGNED		signed
nkeynes@185
    32
#define	_DOTS		, ...
nkeynes@185
    33
#define _VOID void
nkeynes@185
    34
#define	_EXFUN(name, proto)		name proto
nkeynes@185
    35
#define	_DEFUN(name, arglist, args)	name(args)
nkeynes@185
    36
#define	_DEFUN_VOID(name)		name(_NOARGS)
nkeynes@185
    37
#define _CAST_VOID (void)
nkeynes@185
    38
#ifndef _LONG_DOUBLE
nkeynes@185
    39
#define _LONG_DOUBLE long double
nkeynes@185
    40
#endif
nkeynes@185
    41
#ifndef _PARAMS
nkeynes@185
    42
#define _PARAMS(paramlist)		paramlist
nkeynes@185
    43
#endif
nkeynes@185
    44
#else	
nkeynes@185
    45
#define	_PTR		char *
nkeynes@185
    46
#define	_AND		;
nkeynes@185
    47
#define	_NOARGS
nkeynes@185
    48
#define	_CONST
nkeynes@185
    49
#define	_VOLATILE
nkeynes@185
    50
#define	_SIGNED
nkeynes@185
    51
#define	_DOTS
nkeynes@185
    52
#define _VOID void
nkeynes@185
    53
#define	_EXFUN(name, proto)		name()
nkeynes@185
    54
#define	_DEFUN(name, arglist, args)	name arglist args;
nkeynes@185
    55
#define	_DEFUN_VOID(name)		name()
nkeynes@185
    56
#define _CAST_VOID
nkeynes@185
    57
#define _LONG_DOUBLE double
nkeynes@185
    58
#ifndef _PARAMS
nkeynes@185
    59
#define _PARAMS(paramlist)		()
nkeynes@185
    60
#endif
nkeynes@185
    61
#endif
nkeynes@185
    62
nkeynes@185
    63
/* Support gcc's __attribute__ facility.  */
nkeynes@185
    64
nkeynes@185
    65
#ifdef __GNUC__
nkeynes@185
    66
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
nkeynes@185
    67
#else
nkeynes@185
    68
#define _ATTRIBUTE(attrs)
nkeynes@185
    69
#endif
nkeynes@185
    70
nkeynes@185
    71
#endif /* _ANSIDECL_H_ */
.