From d458a417691652b7e7cdef375510fad974332148 Mon Sep 17 00:00:00 2001 From: short <> Date: Fri, 31 Jan 2003 19:34:31 +0000 Subject: [PATCH] Supply __func__ for G_STRLOC when ran on new GCC - drawback: No filename/line-number is displayed now on new GCC --- configure.in | 5 +++++ src/libcaptive/include/captive/Makefile.am | 3 ++- src/libcaptive/include/captive/config2.h | 35 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/libcaptive/include/captive/config2.h diff --git a/configure.in b/configure.in index 147181d..fa32a1b 100644 --- a/configure.in +++ b/configure.in @@ -62,6 +62,11 @@ AH_TOP([ #include /* for 'gchar' */ #define G_LOG_DOMAIN ((const gchar *)"Captive") + +/* Supplemental definitions not possible in this file. */ +#ifdef LIBCAPTIVE +#include "captive/config2.h" +#endif ]) AH_BOTTOM([ #endif /* !_CAPTIVE_CONFIG_H */ diff --git a/src/libcaptive/include/captive/Makefile.am b/src/libcaptive/include/captive/Makefile.am index 87ecf8d..20cfd12 100644 --- a/src/libcaptive/include/captive/Makefile.am +++ b/src/libcaptive/include/captive/Makefile.am @@ -1,6 +1,6 @@ # $Id$ # automake source for include/captive directory Makefile -# Copyright (C) 2002 Jan Kratochvil +# Copyright (C) 2002-2003 Jan Kratochvil # # 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 @@ -25,6 +25,7 @@ pkginclude_HEADERS+= \ client-directory.h \ client-file.h \ client-file_info.h \ + config2.h \ ldr.h \ ldr_exports.h \ macros.h \ diff --git a/src/libcaptive/include/captive/config2.h b/src/libcaptive/include/captive/config2.h new file mode 100644 index 0000000..c2d7fed --- /dev/null +++ b/src/libcaptive/include/captive/config2.h @@ -0,0 +1,35 @@ +/* $Id$ + * Supplemental include file for config.h of libcaptive + * Copyright (C) 2003 Jan Kratochvil + * + * 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; exactly version 2 of June 1991 is required + * + * 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 _CAPTIVE_CONFIG2_H +#define _CAPTIVE_CONFIG2_H 1 + + +/* We need to redefine it here as any '#undef' in config.h gets commented + * out during 'config.h.in' -> 'config.h' pass. + */ +#if defined(__GNUC__) && (__GNUC__ >= 3) +#include /* for 'G_STRLOC' */ +# undef G_STRLOC +/* '__func__' does not string-concatenate! */ +# define G_STRLOC __func__ +#endif + + +#endif /* _CAPTIVE_CONFIG2_H */ -- 1.8.3.1