Patchwork libbacktrace patch committed: Fix test of HAVE_DECL_STRNLEN

login
register
mail settings
Submitter Ian Taylor
Date Sept. 18, 2012, 4:50 p.m.
Message ID <mcr4nmvp95w.fsf@google.com>
Download mbox | patch
Permalink /patch/184760/
State New
Headers show

Comments

Ian Taylor - Sept. 18, 2012, 4:50 p.m.
I foolishly assumed that the autoconf macro AC_CHECK_DECLS worked like
most autoconf macros, and did not define HAVE_DECL_xx when the
declaration is not available.  However, it turns out that it actually
#defines it to 0.  This patch fixes the test of HAVE_DECL_STRNLEN to
match that behaviour.  Bootstrapped and ran libbacktrace testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2012-09-18  Ian Lance Taylor  <iant@google.com>

	* dwarf.c: Correct test of HAVE_DECL_STRNLEN.

Patch

Index: dwarf.c
===================================================================
--- dwarf.c	(revision 191433)
+++ dwarf.c	(working copy)
@@ -44,7 +44,7 @@  POSSIBILITY OF SUCH DAMAGE.  */
 #include "backtrace.h"
 #include "internal.h"
 
-#ifndef HAVE_DECL_STRNLEN
+#if !defined(HAVE_DECL_STRNLEN) || !HAVE_DECL_STRNLEN
 /* The function is defined in libiberty if needed.  */
 extern size_t strnlen (const char *, size_t);
 #endif