[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] strndup: fix m4 usage error
From: |
Eric Blake |
Subject: |
[PATCH] strndup: fix m4 usage error |
Date: |
Fri, 13 Jul 2012 11:46:03 -0600 |
Autoconf guarantees that AC_CHECK_DECLS_ONCE always defines the
corresponding HAVE_DECL_*, so checking #ifndef HAVE_DECL_* is bogus.
https://lists.gnu.org/archive/html/coreutils/2012-06/msg00037.html
* m4/strndup.m4 (gl_FUNC_STRNDUP): HAVE_DECL_STRNDUP is always
defined, to either 0 or 1.
Reported by Karel Zak.
Signed-off-by: Eric Blake <address@hidden>
---
I'm pushing this.
ChangeLog | 7 +++++++
m4/strndup.m4 | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 097c90d..a35ea2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-13 Eric Blake <address@hidden>
+
+ strndup: fix m4 usage error
+ * m4/strndup.m4 (gl_FUNC_STRNDUP): HAVE_DECL_STRNDUP is always
+ defined, to either 0 or 1.
+ Reported by Karel Zak.
+
2012-07-11 Jim Meyering <address@hidden>
maint: enable the sc_avoid_if_before_free syntax-check rule
diff --git a/m4/strndup.m4 b/m4/strndup.m4
index bdde5fe..cef6889 100644
--- a/m4/strndup.m4
+++ b/m4/strndup.m4
@@ -1,4 +1,4 @@
-# strndup.m4 serial 20
+# strndup.m4 serial 21
dnl Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <string.h>
#include <stdlib.h>]], [[
-#ifndef HAVE_DECL_STRNDUP
+#if !HAVE_DECL_STRNDUP
extern
#ifdef __cplusplus
"C"
--
1.7.10.4
- [PATCH] strndup: fix m4 usage error,
Eric Blake <=