[PR lto/61334] Declare prototype for strnlen, if needed.
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 10 Jun 2014 09:45:00 +0000 (11:45 +0200)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Tue, 10 Jun 2014 09:45:00 +0000 (11:45 +0200)
include/
* libiberty.h [defined (HAVE_DECL_STRNLEN) &&
!HAVE_DECL_STRNLEN] (strnlen): New prototype.
gcc/
* configure.ac: Use gcc_AC_CHECK_DECLS to check for strnlen
prototype.
* config.in: Regenerate.
* configure: Likewise.

From-SVN: r211401

gcc/ChangeLog
gcc/config.in
gcc/configure
gcc/configure.ac
include/ChangeLog
include/libiberty.h

index 4841582fb5e6374fc56f49117c844bd4dd9f3fb9..5d55985ce1485206c3a0c2fbac0172be21f8be47 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-10  Thomas Schwinge  <thomas@codesourcery.com>
+
+       PR lto/61334
+       * configure.ac: Use gcc_AC_CHECK_DECLS to check for strnlen
+       prototype.
+       * config.in: Regenerate.
+       * configure: Likewise.
+
 2014-06-10  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-reference.c (is_proper_for_analysis): Exclude addressable and public
index fb7bf954db2203729f7aa2e9f0aaf0b3da5c92f7..0897bd4045896a31f6005dd6bdcbd76a7c2a058d 100644 (file)
 #endif
 
 
+/* Define to 1 if we found a declaration for 'strnlen', otherwise define to 0.
+   */
+#ifndef USED_FOR_TARGET
+#undef HAVE_DECL_STRNLEN
+#endif
+
+
 /* Define to 1 if we found a declaration for 'strsignal', otherwise define to
    0. */
 #ifndef USED_FOR_TARGET
index 6c35041b6a79039fa72b683e0f2b31dc7d833abd..9ece2437656a7126c53172cbcbc43d6a15472297 100755 (executable)
@@ -10525,7 +10525,7 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 saved_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \
-       strsignal strstr stpcpy strverscmp \
+       stpcpy strnlen strsignal strstr strverscmp \
        errno snprintf vsnprintf vasprintf malloc realloc calloc \
        free basename getopt clock getpagesize ffs clearerr_unlocked feof_unlocked   ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked   fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked   putchar_unlocked putc_unlocked
 do
index 2cec62a7eaead684c54039e37a22ee2e401bf76e..a1cf9010474432bd20f48c83c70c42af0b37b1c1 100644 (file)
@@ -1170,7 +1170,7 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 saved_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
-       strsignal strstr stpcpy strverscmp \
+       stpcpy strnlen strsignal strstr strverscmp \
        errno snprintf vsnprintf vasprintf malloc realloc calloc \
        free basename getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[
 #include "ansidecl.h"
index ff33d291e74e3b10b3ebda061ba5ba4af7ac8755..1cda0dc02b11da86e90eea7f2edf9cd54a9fa1a6 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-10  Thomas Schwinge  <thomas@codesourcery.com>
+
+       PR lto/61334
+       * libiberty.h [defined (HAVE_DECL_STRNLEN) &&
+       !HAVE_DECL_STRNLEN] (strnlen): New prototype.
+
 2014-05-21  John Marino  <gnugcc@marino.st>
 
        * liberty.h: Use basename function on DragonFly.
index 7fd07036b75a57b93f9d253b4d0446632e445b0d..56b8b43cb887a845141d99e218f8626a426d3bdc 100644 (file)
@@ -636,6 +636,10 @@ extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;
 extern int vsnprintf (char *, size_t, const char *, va_list) ATTRIBUTE_PRINTF(3,0);
 #endif
 
+#if defined (HAVE_DECL_STRNLEN) && !HAVE_DECL_STRNLEN
+extern size_t strnlen (const char *, size_t);
+#endif
+
 #if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP
 /* Compare version strings.  */
 extern int strverscmp (const char *, const char *);