Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / gcc / gansidecl.h
1 /* ANSI and traditional C compatibility macros.
2    Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* This file mimics some of the support provided by include/ansidecl.h
22    in binutils and gdb releases.
23    ??? Over time the two should be merged into one.  */
24
25 #ifndef __GANSIDECL_H__
26 #define __GANSIDECL_H__
27
28 #include "ansidecl.h"
29
30 /* Undef ansidecl.h's "obsolete" version. */
31 #undef PROTO
32 /* These macros are deprecated, use ansidecl.h's PARAMS style instead. */
33 #define PROTO(ARGS) PARAMS(ARGS)
34 #define VPROTO(ARGS) VPARAMS(ARGS)
35 #define PVPROTO(ARGS) PARAMS(ARGS)
36
37 /* Autoconf will possibly define the `inline' or `const' keywords as
38    macros, however this is only valid for the stage1 compiler.  If we
39    detect a modern version of gcc, unconditionally reset the values.
40    This makes sure the right thing happens in stage2 and later.  We
41    need to do this very early; i.e. before any systems header files or
42    gcc header files in case they use these keywords.  Otherwise
43    conflicts might occur. */
44 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
45 # undef const
46 # undef inline
47 # define inline __inline__  /* Modern gcc can use `__inline__' freely. */
48 #endif /* GCC >= 2.7 */
49
50 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
51 # define __attribute__(x)
52 #endif
53
54 #ifndef ATTRIBUTE_UNUSED_LABEL
55 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
56 #  define ATTRIBUTE_UNUSED_LABEL
57 # else
58 #  define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
59 # endif /* GNUC < 2.93 */
60 #endif /* ATTRIBUTE_UNUSED_LABEL */
61
62 #ifndef ATTRIBUTE_UNUSED
63 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
64 #endif /* ATTRIBUTE_UNUSED */
65
66 #ifndef ATTRIBUTE_NORETURN
67 #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
68 #endif /* ATTRIBUTE_NORETURN */
69
70 #ifndef ATTRIBUTE_PRINTF
71 #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
72 #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
73 #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
74 #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
75 #define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
76 #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
77 #endif /* ATTRIBUTE_PRINTF */
78
79 #define GENERIC_PTR PTR
80
81 #ifndef NULL_PTR
82 #define NULL_PTR ((PTR) 0)
83 #endif
84
85 #endif /* __GANSIDECL_H__ */