From 64f62168ef931afaa0a57fadf9b4410cadcbe249 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 6 Apr 1999 22:24:20 -0600 Subject: [PATCH] Sync * Add symcat file. * libiberty.h expose basename prototype on more systems From-SVN: r26238 --- include/ChangeLog | 8 ++++++++ include/libiberty.h | 2 +- include/symcat.h | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 include/symcat.h diff --git a/include/ChangeLog b/include/ChangeLog index 5f53829d34a..120fb2adb87 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -6,6 +6,10 @@ * splay-tree.h (splay_tree_compare_ints): Declare. +Wed Mar 24 12:46:29 1999 Andrew Cagney + + * libiberty.h (basename): Cygwin{,32} should have the prototype. + Mon Dec 14 09:53:31 1998 Kaveh R. Ghazi * demangle.h: Don't check IN_GCC anymore. @@ -26,6 +30,10 @@ Tue Dec 8 00:30:31 1998 Elena Zannoni (ARM_DEMANGLING): coerce to int. (HP_DEMANGLING): new macro. +Fri Nov 20 13:14:00 1998 Andrew Cagney + + * libiberty.h (basename): Add prototype for FreeBSD. + Fri Nov 13 19:19:11 1998 Kaveh R. Ghazi * libiberty.h: Prototype xcalloc. diff --git a/include/libiberty.h b/include/libiberty.h index 86fec2dd656..cf313662ef4 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -36,7 +36,7 @@ extern char **dupargv PARAMS ((char **)); across different systems, sometimes as "char *" and sometimes as "const char *" */ -#if defined(__GNU_LIBRARY__ ) || defined (__linux__) +#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) extern char *basename PARAMS ((const char *)); #else extern char *basename (); diff --git a/include/symcat.h b/include/symcat.h new file mode 100644 index 00000000000..01efada2618 --- /dev/null +++ b/include/symcat.h @@ -0,0 +1,40 @@ +/* Symbol concatenation utilities. + + Copyright (C) 1998, Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef SYM_CAT_H +#define SYM_CAT_H + +#if defined (__STDC__) || defined (ALMOST_STDC) +#define CONCAT2(a,b) a##b +#define CONCAT3(a,b,c) a##b##c +#define CONCAT4(a,b,c,d) a##b##c##d +#define STRINGX(s) #s +#else +#define CONCAT2(a,b) a/**/b +#define CONCAT3(a,b,c) a/**/b/**/c +#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d +#define STRINGX(s) "?" +#endif + +#define XCONCAT2(a,b) CONCAT2(a,b) +#define XCONCAT3(a,b,c) CONCAT3(a,b,c) +#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d) + +#define XSTRING(s) STRINGX(s) + +#endif SYM_CAT_H