From cd3bee968885a85671cad267e142aad74076b5e2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 2 Mar 2005 17:19:44 +0000 Subject: [PATCH] Fix for AIX. --- lib/ChangeLog | 5 +++++ lib/stpncpy.h | 11 ++++++----- m4/ChangeLog | 7 +++++++ m4/stpncpy.m4 | 4 +--- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index dc6bc11eff..410304fd13 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2005-01-28 Bruno Haible + + * stpncpy.h (stpncpy): Define as a macro without arguments, so that + stpncpy.c uses it. + 2005-03-01 Paul Eggert Remove workaround for bug in Linux kernel 2.6.8 or thereabouts. diff --git a/lib/stpncpy.h b/lib/stpncpy.h index 6dc92a8132..6bcdbdd613 100644 --- a/lib/stpncpy.h +++ b/lib/stpncpy.h @@ -1,5 +1,5 @@ /* String copying. - Copyright (C) 1995, 2001-2004 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,12 +28,13 @@ extern "C" { #if !HAVE_STPNCPY -/* Copy no more than N bytes of SRC to DST, returning a pointer past the - last non-NUL byte written into DST. */ /* When not using the GNU libc we use the stpncpy implementation we provide here. */ -extern char *gnu_stpncpy (char *dst, const char *src, size_t n); -#define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N) +#define stpncpy gnu_stpncpy + +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +extern char *stpncpy (char *dst, const char *src, size_t n); #endif diff --git a/m4/ChangeLog b/m4/ChangeLog index 2d39f2446a..09276ad159 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2005-01-28 Bruno Haible + + * stpncpy.m4 (gl_FUNC_STPNCPY): Undo the replacement here. Because of + AIX, the replacement has to be done only after is included, + therefore not in config.h. stpncpy.h does the replacement, and + stpncpy.c uses it. + 2005-03-01 Paul Eggert * xnanosleep.m4 (gl_XNANOSLEEP): Remove configuration attempting diff --git a/m4/stpncpy.m4 b/m4/stpncpy.m4 index 8efd1a9c32..1ab377c986 100644 --- a/m4/stpncpy.m4 +++ b/m4/stpncpy.m4 @@ -1,4 +1,4 @@ -# stpncpy.m4 serial 2 +# stpncpy.m4 serial 3 dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -49,8 +49,6 @@ int main () { AC_DEFINE(HAVE_STPNCPY, 1, [Define if you have the stpncpy() function and it works.]) else - AC_DEFINE([stpncpy], [gnu_stpncpy], - [Define to a replacement function name for stpncpy().]) AC_LIBOBJ([stpncpy]) gl_PREREQ_STPNCPY fi -- 2.30.2