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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [include/] [sys/] [cdefs.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
//==========================================================================
2
//
3
//      include/sys/cdefs.h
4
//
5
//      
6
//
7
//==========================================================================
8
//####BSDCOPYRIGHTBEGIN####
9
//
10
// -------------------------------------------
11
//
12
// Portions of this software may have been derived from OpenBSD or other sources,
13
// and are covered by the appropriate copyright disclaimers included herein.
14
//
15
// -------------------------------------------
16
//
17
//####BSDCOPYRIGHTEND####
18
//==========================================================================
19
//#####DESCRIPTIONBEGIN####
20
//
21
// Author(s):    gthomas
22
// Contributors: gthomas
23
// Date:         2000-01-10
24
// Purpose:      
25
// Description:  
26
//              
27
//
28
//####DESCRIPTIONEND####
29
//
30
//==========================================================================
31
 
32
 
33
/*      $OpenBSD: cdefs.h,v 1.5 1996/09/27 17:34:44 maja Exp $  */
34
/*      $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $      */
35
 
36
/*
37
 * Copyright (c) 1991, 1993
38
 *      The Regents of the University of California.  All rights reserved.
39
 *
40
 * This code is derived from software contributed to Berkeley by
41
 * Berkeley Software Design, Inc.
42
 *
43
 * Redistribution and use in source and binary forms, with or without
44
 * modification, are permitted provided that the following conditions
45
 * are met:
46
 * 1. Redistributions of source code must retain the above copyright
47
 *    notice, this list of conditions and the following disclaimer.
48
 * 2. Redistributions in binary form must reproduce the above copyright
49
 *    notice, this list of conditions and the following disclaimer in the
50
 *    documentation and/or other materials provided with the distribution.
51
 * 3. All advertising materials mentioning features or use of this software
52
 *    must display the following acknowledgement:
53
 *      This product includes software developed by the University of
54
 *      California, Berkeley and its contributors.
55
 * 4. Neither the name of the University nor the names of its contributors
56
 *    may be used to endorse or promote products derived from this software
57
 *    without specific prior written permission.
58
 *
59
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69
 * SUCH DAMAGE.
70
 *
71
 *      @(#)cdefs.h     8.7 (Berkeley) 1/21/94
72
 */
73
 
74
#ifndef _SYS_CDEFS_H_
75
#define _SYS_CDEFS_H_
76
 
77
/*
78
 * Gratuitous NetBSD gcc extensions we can do without.
79
 */
80
 
81
#ifdef __KPRINTF_ATTRIBUTE__
82
#undef __KPRINTF_ATTRIBUTE__
83
#endif
84
 
85
#include <machine/cdefs.h>
86
 
87
#if defined(__cplusplus)
88
#define __BEGIN_DECLS   extern "C" {
89
#define __END_DECLS     };
90
#else
91
#define __BEGIN_DECLS
92
#define __END_DECLS
93
#endif
94
 
95
/*
96
 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
97
 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
98
 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
99
 * in between its arguments.  __CONCAT can also concatenate double-quoted
100
 * strings produced by the __STRING macro, but this only works with ANSI C.
101
 */
102
#if defined(__STDC__) || defined(__cplusplus)
103
#define __P(protos)     protos          /* full-blown ANSI C */
104
#define __CONCAT(x,y)   x ## y
105
#define __STRING(x)     #x
106
 
107
#define __const         const           /* define reserved names to standard */
108
#define __signed        signed
109
#define __volatile      volatile
110
#if defined(__cplusplus)
111
#define __inline        inline          /* convert to C++ keyword */
112
#else
113
#if !defined(__GNUC__) && !defined(lint)
114
#define __inline                        /* delete GCC keyword */
115
#endif /* !__GNUC__ && !lint */
116
#endif /* !__cplusplus */
117
 
118
#else   /* !(__STDC__ || __cplusplus) */
119
#define __P(protos)     ()              /* traditional C preprocessor */
120
#define __CONCAT(x,y)   x/**/y
121
#define __STRING(x)     "x"
122
 
123
#if !defined(__GNUC__) && !defined(lint)
124
#define __const                         /* delete pseudo-ANSI C keywords */
125
#define __inline
126
#define __signed
127
#define __volatile
128
#endif  /* !__GNUC__ && !lint */
129
 
130
/*
131
 * In non-ANSI C environments, new programs will want ANSI-only C keywords
132
 * deleted from the program and old programs will want them left alone.
133
 * Programs using the ANSI C keywords const, inline etc. as normal
134
 * identifiers should define -DNO_ANSI_KEYWORDS.
135
 */
136
#ifndef NO_ANSI_KEYWORDS
137
#define const           __const         /* convert ANSI C keywords */
138
#define inline          __inline
139
#define signed          __signed
140
#define volatile        __volatile
141
#endif /* !NO_ANSI_KEYWORDS */
142
#endif  /* !(__STDC__ || __cplusplus) */
143
 
144
/*
145
 * GCC1 and some versions of GCC2 declare dead (non-returning) and
146
 * pure (no side effects) functions using "volatile" and "const";
147
 * unfortunately, these then cause warnings under "-ansi -pedantic".
148
 * GCC2 uses a new, peculiar __attribute__((attrs)) style.  All of
149
 * these work for GNU C++ (modulo a slight glitch in the C++ grammar
150
 * in the distribution version of 2.5.5).
151
 */
152
#if !defined(__GNUC__) || __GNUC__ < 2 || \
153
        (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
154
#define __attribute__(x)        /* delete __attribute__ if non-gcc or gcc1 */
155
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
156
#define __dead          __volatile
157
#define __pure          __const
158
#endif
159
#endif
160
 
161
#ifdef __KPRINTF_ATTRIBUTE__
162
#define __kprintf_attribute__(a) __attribute__(a)
163
#else
164
#define __kprintf_attribute__(a)
165
#endif
166
 
167
/* Delete pseudo-keywords wherever they are not available or needed. */
168
#ifndef __dead
169
#define __dead
170
#define __pure
171
#endif
172
 
173
#endif /* !_SYS_CDEFS_H_ */

powered by: WebSVN 2.1.0

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