This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH, fortran] Rename local strcasestr
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Sun, 24 Jun 2007 10:45:38 -0700
- Subject: [PATCH, fortran] Rename local strcasestr
This change is needed to fix the build for mipsisa64-elf out of a
combined tree.
The link test for strcasestr fails in configure because this target
does not actually link to newlib while configuring (see
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01684.html). There is
obviously still a non-static declaration of strcasestr which clashes
which the static definition in this file. The patch renames the local
definition.
mipsisa64-elf builds now. Also bootstrapped and tested on
x64_64-linux.
OK?
Adam
* runtime/backtrace.c (local_strcasestr): Rename from strcasestr.
(show_backtrace): Rename strcasestr to local_strcasestr.
Index: backtrace.c
===================================================================
--- backtrace.c (revision 125932)
+++ backtrace.c (working copy)
@@ -68,11 +68,13 @@ Boston, MA 02110-1301, USA. */
-#ifndef HAVE_STRCASESTR
-#define HAVE_STRCASESTR 1
static char *
-strcasestr (const char *s1, const char *s2)
+local_strcasestr (const char *s1, const char *s2)
{
+#ifdef HAVE_STRCASESTR
+ return strcasestr (s1, s2);
+#else
+
const char *p = s1;
const size_t len = strlen (s2);
const char u = *s2, v = isupper((int) *s2) ? tolower((int) *s2)
@@ -88,8 +90,8 @@ strcasestr (const char *s1, const char *
if (strncasecmp (p, s2, len) == 0)
return (char *)p;
}
-}
#endif
+}
#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \
&& defined(HAVE_WAIT))
@@ -224,9 +226,9 @@ show_backtrace (void)
|| strcmp (func, "main") == 0 || strcmp (func, "_start") == 0)
continue;
- if (strcasestr (str[i], "libgfortran.so") != NULL
- || strcasestr (str[i], "libgfortran.dylib") != NULL
- || strcasestr (str[i], "libgfortran.a") != NULL)
+ if (local_strcasestr (str[i], "libgfortran.so") != NULL
+ || local_strcasestr (str[i], "libgfortran.dylib") != NULL
+ || local_strcasestr (str[i], "libgfortran.a") != NULL)
continue;
/* If we only have the address, use the glibc backtrace. */