OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [include/] [_ansi.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/* 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 56 joel
   To get a strict ANSI C environment, define macro __STRICT_ANSI__.  This will
9 39 lampret
   "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
#define _EXFUN(name, proto)             name proto
35
#define _DEFUN(name, arglist, args)     name(args)
36
#define _DEFUN_VOID(name)               name(_NOARGS)
37
#define _CAST_VOID (void)
38
#ifndef _LONG_DOUBLE
39
#define _LONG_DOUBLE long double
40
#endif
41
#ifndef _PARAMS
42
#define _PARAMS(paramlist)              paramlist
43
#endif
44
#else   
45
#define _PTR            char *
46
#define _AND            ;
47
#define _NOARGS
48
#define _CONST
49
#define _VOLATILE
50
#define _SIGNED
51
#define _DOTS
52
#define _VOID void
53
#define _EXFUN(name, proto)             name()
54
#define _DEFUN(name, arglist, args)     name arglist args;
55
#define _DEFUN_VOID(name)               name()
56
#define _CAST_VOID
57
#define _LONG_DOUBLE double
58
#ifndef _PARAMS
59
#define _PARAMS(paramlist)              ()
60
#endif
61
#endif
62
 
63
/* Support gcc's __attribute__ facility.  */
64
 
65
#ifdef __GNUC__
66
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
67
#else
68
#define _ATTRIBUTE(attrs)
69
#endif
70
 
71
#endif /* _ANSIDECL_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.