From: Bruno Haible Date: Sat, 9 Mar 2002 03:40:18 +0000 (+0000) Subject: AIX 4.3.3 has an incompatible stpncpy(). X-Git-Tag: v0.11.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=460180a063bd67c309c99ccecff037023e43dcdb;p=thirdparty%2Fgettext.git AIX 4.3.3 has an incompatible stpncpy(). --- diff --git a/ChangeLog b/ChangeLog index 6d822ac79..ca5ebffe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-09 Bruno Haible + + * configure.in: Don't check for stpncpy; AIX 4.3.3 has an incompatible + implementation of it. + * acconfig.h (HAVE_STPNCPY): Define on glibc systems only. + 2002-03-07 Bruno Haible * Makefile.am (MAKEINFO): New variable. diff --git a/acconfig.h b/acconfig.h index 2407bc32b..21e44d6db 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,5 +1,5 @@ /* Special definitions, processed by autoheader. - Copyright (C) 1995-1998, 2001 Free Software Foundation. + Copyright (C) 1995-1998, 2001-2002 Free Software Foundation. Ulrich Drepper , 1995. */ /* Default value for alignment of strings in .mo file. */ @@ -24,9 +24,11 @@ @BOTTOM@ /* We don't test for the basename function but still want to use the - version in the libc when compiling for a system using glibc. */ + version in the libc when compiling for a system using glibc. Likewise + for stpncpy. */ #ifdef __GNU_LIBRARY__ # define HAVE_BASENAME 1 +# define HAVE_STPNCPY 1 #endif diff --git a/configure.in b/configure.in index 8d5e24654..48a7ff422 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,8 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) AC_INIT(src/msgfmt.c) -AM_INIT_AUTOMAKE(gettext, 0.11) -RELEASE_DATE=2002-01-31 dnl in "date +%Y-%m-%d" format +AM_INIT_AUTOMAKE(gettext, 0.11.1) +RELEASE_DATE=2002-03-07 dnl in "date +%Y-%m-%d" format AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -68,7 +68,7 @@ AC_FUNC_ALLOCA AC_FUNC_VPRINTF AC_CHECK_FUNCS([getcwd mblen memcpy posix_spawn putc_unlocked raise select \ strerror strtoul uname utime utimes]) -AC_REPLACE_FUNCS([memset stpcpy stpncpy strcspn \ +AC_REPLACE_FUNCS([memset stpcpy strcspn \ strcasecmp strncasecmp strpbrk strstr vasprintf]) AM_FUNC_GETLINE if test $am_cv_func_working_getline != yes; then diff --git a/lib/ChangeLog b/lib/ChangeLog index 371e4f2a4..d23a99e05 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,13 @@ +2002-03-09 Bruno Haible + + Portability to AIX 4.3.3. + * stpncpy.h (gnu_stpncpy): Renamed from stpncpy. + (stpncpy): Define as an alias. + * stpncpy.c: Compile nothing on glibc systems is set. Otherwise name + the function gnu_stpncpy. + * Makefile.am (LIBADD_SOURCE): Remove stpncpy.h, stpncpy.c. + (libgettextlib_la_SOURCES): Add stpncpy.h, stpncpy.c. + 2002-03-04 Bruno Haible Portability to AIX 4.3.3. diff --git a/lib/Makefile.am b/lib/Makefile.am index a566bd891..c16c7fd99 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -52,6 +52,7 @@ libgettextlib_la_SOURCES = \ progname.h progname.c \ safe-read.h safe-read.c \ sh-quote.h sh-quote.c \ + stpncpy.h stpncpy.c \ strtoul.c \ tmpdir.h tmpdir.c \ ucs4-utf8.h ucs4-utf16.h \ @@ -71,7 +72,6 @@ LIBADD_SOURCE = \ setenv.h setenv.c unsetenv.c \ libstdarg.h \ stpcpy.h stpcpy.c \ - stpncpy.h stpncpy.c \ strcase.h strcasecmp.c strncasecmp.c \ strcspn.c \ strpbrk.h strpbrk.c \ diff --git a/lib/stpncpy.c b/lib/stpncpy.c index c489f76b2..cb34e08c6 100644 --- a/lib/stpncpy.c +++ b/lib/stpncpy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995-1997, 2002 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -24,10 +24,19 @@ # include #endif +/* Specification. */ +#include "stpncpy.h" + +#ifndef __GNU_LIBRARY__ + #ifdef _LIBC # include #else # include +/* We cannot generally use the name 'stpncpy' since AIX 4 defines an unusable + variant of the function but we cannot use it. */ +# undef stpncpy +# define stpncpy gnu_stpncpy #endif #ifndef weak_alias @@ -99,3 +108,5 @@ __stpncpy (dest, src, n) #ifdef weak_alias weak_alias (__stpncpy, stpncpy) #endif + +#endif diff --git a/lib/stpncpy.h b/lib/stpncpy.h index 0c4df53d0..2b1e680fb 100644 --- a/lib/stpncpy.h +++ b/lib/stpncpy.h @@ -1,5 +1,5 @@ /* String copying. - Copyright (C) 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2002 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 @@ -26,16 +26,14 @@ # endif #endif -#if HAVE_STPNCPY - -/* Get stpncpy() declaration. */ #include -#else - -#include +#ifndef __GNU_LIBRARY__ -extern char *stpncpy PARAMS ((char *__dst, const char *__src, size_t __n)); +/* When not using the GNU libc we use the stpncpy implementation we + provide here. */ +extern char *gnu_stpncpy PARAMS ((char *__dst, const char *__src, size_t __n)); +#define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N) #endif