diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-03-30 20:34:57 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-03-30 20:34:57 +0000 |
commit | 01b4d31847394cba8639b28b75c9680dd75ed7cf (patch) | |
tree | 38d937e644264ca8deb19eeb6264963b5b84740f /include/ansidecl.h | |
parent | 3f031adf9f8db098550eedd752d71edb96dc2849 (diff) | |
download | gdb-01b4d31847394cba8639b28b75c9680dd75ed7cf.zip gdb-01b4d31847394cba8639b28b75c9680dd75ed7cf.tar.gz gdb-01b4d31847394cba8639b28b75c9680dd75ed7cf.tar.bz2 |
Use ANSI versions on AIX regardless of __STDC__.
Diffstat (limited to 'include/ansidecl.h')
-rw-r--r-- | include/ansidecl.h | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/include/ansidecl.h b/include/ansidecl.h index f5b61aa..8434f28 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -1,5 +1,5 @@ /* ANSI and traditional C compatability macros - Copyright 1991 Free Software Foundation, Inc. + Copyright 1991, 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -29,7 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ SIGNED `signed' `' PTRCONST `void *const' `char *' - DEFUN(name, arglist, args) + DEFUN (name, arglist, args) Defines function NAME. @@ -41,19 +41,38 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ be separated with `AND'. For functions with a variable number of arguments, the last thing listed should be `DOTS'. - DEFUN_VOID(name) + DEFUN_VOID (name) Defines a function NAME, which takes no arguments. - EXFUN(name, prototype) + obsolete -- EXFUN (name, (prototype)) -- obsolete. - Is used in an external function declaration. - In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in + Replaced by PARAMS. Do not use; will disappear someday soon. + Was used in external function declarations. + In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. + For a function that takes no arguments, PROTOTYPE should be `(void)'. + + PARAMS ((args)) + + We could use the EXFUN macro to handle prototype declarations, but + the name is misleading and the result is ugly. So we just define a + simple macro to handle the parameter lists, as in: + + static int foo PARAMS ((int, char)); + + This produces: `static int foo();' or `static int foo (int, char);' + + EXFUN would have done it like this: + + static int EXFUN (foo, (int, char)); + + but the function is not external...and it's hard to visually parse + the function name out of the mess. EXFUN should be considered + obsolete; new code should be written to use PARAMS. For example: - extern int EXFUN(printf, (CONST char *format DOTS)); + extern int printf PARAMS ((CONST char *format DOTS)); int DEFUN(fprintf, (stream, format), FILE *stream AND CONST char *format DOTS) { ... } void DEFUN_VOID(abort) { ... } @@ -69,7 +88,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* LINTLIBRARY */ -#ifdef __STDC__ +#if defined (__STDC__) || defined (_AIX) +/* the AIX xlc compiler implements all these things even when it is in + a mode which doesn't define __STDC__. */ #define PTR void * #define PTRCONST void *CONST @@ -84,10 +105,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define EXFUN(name, proto) name proto #define DEFUN(name, arglist, args) name(args) -#define DEFUN_VOID(name) name(NOARGS) +#define DEFUN_VOID(name) name(void) -#define PROTO(type, name, arglist) type name arglist -#endif +#define PROTO(type, name, arglist) type name arglist +#define PARAMS(paramlist) paramlist #else /* Not ANSI C. */ @@ -106,7 +127,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define DEFUN(name, arglist, args) name arglist args; #define DEFUN_VOID(name) name() #define PROTO(type, name, arglist) type name () -#endif /* ANSI C. */ +#define PARAMS(paramlist) () +#endif /* ANSI C. */ #endif /* ansidecl.h */ |