1 /* Provide support for both ANSI and non-ANSI environments. */ 2 3 /* Some ANSI environments are "broken" in the sense that __STDC__ cannot be 4 relied upon to have it's intended meaning. Therefore we must use our own 5 concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib 6 sources! 7 8 To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will 9 "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header 10 files aren't affected). */ 11 12 #ifndef _ANSIDECL_H_ 13 #define _ANSIDECL_H_ 14 15 #include <sys/config.h> 16 17 /* First try to figure out whether we really are in an ANSI C environment. */ 18 /* FIXME: This probably needs some work. Perhaps sys/config.h can be 19 prevailed upon to give us a clue. */ 20 21 #ifdef __STDC__ 22 #define _HAVE_STDC 23 #endif 24 25 #ifdef _HAVE_STDC 26 #define _PTR void * 27 #define _AND , 28 #define _NOARGS void 29 #define _CONST const 30 #define _VOLATILE volatile 31 #define _SIGNED signed 32 #define _DOTS , ... 33 #define _VOID void 34 #ifdef __CYGWIN__ 35 #define _EXFUN(name, proto) __cdecl name proto 36 #define _EXPARM(name, proto) (* __cdecl name) proto 37 #else 38 #define _EXFUN(name, proto) name proto 39 #define _EXPARM(name, proto) (* name) proto 40 #endif 41 #define _DEFUN(name, arglist, args) name(args) 42 #define _DEFUN_VOID(name) name(_NOARGS) 43 #define _CAST_VOID (void) 44 #ifndef _LONG_DOUBLE 45 #define _LONG_DOUBLE long double 46 #endif 47 #ifndef _PARAMS 48 #define _PARAMS(paramlist) paramlist 49 #endif 50 #else 51 #define _PTR char * 52 #define _AND ; 53 #define _NOARGS 54 #define _CONST 55 #define _VOLATILE 56 #define _SIGNED 57 #define _DOTS 58 #define _VOID void 59 #define _EXFUN(name, proto) name() 60 #define _DEFUN(name, arglist, args) name arglist args; 61 #define _DEFUN_VOID(name) name() 62 #define _CAST_VOID 63 #define _LONG_DOUBLE double 64 #ifndef _PARAMS 65 #define _PARAMS(paramlist) () 66 #endif 67 #endif 68 69 /* Support gcc's __attribute__ facility. */ 70 71 #ifdef __GNUC__ 72 #define _ATTRIBUTE(attrs) __attribute__ (attrs) 73 #else 74 #define _ATTRIBUTE(attrs) 75 #endif 76 77 #endif /* _ANSIDECL_H_ */ |