+2006-09-28 Bruno Haible <bruno@clisp.org>
+
+ * strndup.h: Simplify the redefinition of strndup.
+ (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
+
2006-09-28 Bruno Haible <bruno@clisp.org>
* gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <string.h>
+/* Get size_t. */
#include <stddef.h>
+/* If HAVE_STRNDUP, get the strndup declaration.
+ If !HAVE_STRNDUP, include <string.h> now so that it doesn't cause
+ trouble if included later. */
+#include <string.h>
-#ifdef __STRNDUP_PREFIX
-# define _GL_CONCAT(x, y) x ## y
-# define _GL_XCONCAT(x, y) _GL_CONCAT (x, y)
-# define __STRNDUP_ID(y) _GL_XCONCAT (__STRNDUP_PREFIX, y)
+#if !HAVE_STRNDUP
# undef strndup
-# define strndup __STRNDUP_ID (strndup)
-# if !HAVE_DECL_STRNDUP
+# define strndup rpl_strndup
+# if !HAVE_DECL_STRNDUP /* Don't risk conflicting declarations. */
/* Return a newly allocated copy of at most N bytes of STRING. */
extern char *strndup (const char *string, size_t n);
# endif
+2006-09-28 Bruno Haible <bruno@clisp.org>
+
+ * strndup.m4 (gl_FUNC_STRNDUP): Don't define __STRNDUP_PREFIX.
+
2006-09-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* intmax.m4 (gt_TYPE_INTMAX_T): Avoid unused variables warning.
-# strndup.m4 serial 10
+# strndup.m4 serial 11
dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFINE([HAVE_STRNDUP], 1,
[Define if you have the strndup() function and it works.])
else
- AC_DEFINE([__STRNDUP_PREFIX], [[rpl_]],
- [Define to rpl_ if the strndup replacement function should be used.])
AC_LIBOBJ([strndup])
gl_PREREQ_STRNDUP
fi