From: Bruno Haible Date: Fri, 31 Jan 2003 15:47:03 +0000 (+0000) Subject: Make this module usable in shared libraries. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=590547f814cc8448c5032f2f927cc26d26904e95;p=pspp Make this module usable in shared libraries. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 6d69f196a8..9bc4367532 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-01-31 Bruno Haible + + * rename.c: #undef rename before defining rpl_rename. + * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen. + 2003-01-30 Bruno Haible * printf-args.h: New file, from GNU gettext. diff --git a/lib/rename.c b/lib/rename.c index 70ff13018b..4a4c165b2c 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -1,7 +1,7 @@ /* Work around the bug in some systems whereby rename fails when the source path has a trailing slash. The rename functions of SunOS 4.1.1_U1 and mips-dec-ultrix4.4 have this bug. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 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 @@ -19,7 +19,11 @@ /* written by Volker Borchert */ -#include +#if HAVE_CONFIG_H +# include +#endif +#undef rename + #include #if HAVE_STDLIB_H # include diff --git a/lib/strnlen.c b/lib/strnlen.c index b6c710269c..e7ad6d2f06 100644 --- a/lib/strnlen.c +++ b/lib/strnlen.c @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 1996, 1997, 1998, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2000-2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,16 +20,13 @@ #if HAVE_CONFIG_H # include #endif +#undef strnlen #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif -/* Temporarily redefine strnlen so that an inconsistent prototype - (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't cause trouble. */ -# define strnlen system_strnlen # include -# undef strnlen #else # include #endif @@ -44,6 +41,10 @@ char *memchr (); #undef __strnlen #undef strnlen +#ifndef _LIBC +# define strnlen rpl_strnlen +#endif + #ifndef weak_alias # define __strnlen strnlen #endif diff --git a/m4/ChangeLog b/m4/ChangeLog index d1b76c7a8c..92336bdccf 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,14 @@ +2003-01-31 Bruno Haible + + * rename.m4 (vb_FUNC_RENAME): Add a redirection from 'rename' to + 'rpl_rename'. + * strnlen.m4 (gl_FUNC_STRNLEN): Add a redirection from 'strnlen' to + 'rpl_strnlen'. + * strtod.m4 (gl_FUNC_STRTOD): Add a redirection from 'strtod' to + 'rpl_strtod'. + * utime.m4 (jm_FUNC_UTIME): Add a redirection from 'utime' to + 'rpl_utime'. + 2003-01-30 Bruno Haible * signed.m4: New file, from GNU gettext. diff --git a/m4/rename.m4 b/m4/rename.m4 index 5c1e1ced06..a2e0d74fd6 100644 --- a/m4/rename.m4 +++ b/m4/rename.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl From Volker Borchert. dnl Determine whether rename works for source paths with a trailing slash. @@ -33,6 +33,8 @@ AC_DEFUN([vb_FUNC_RENAME], ]) if test $vb_cv_func_rename_trailing_slash_bug = yes; then AC_LIBOBJ(rename) + AC_DEFINE(rename, rpl_rename, + [Define to rpl_rename if the replacement function should be used.]) AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1, [Define if rename does not work for source paths with a trailing slash, like the one from SunOS 4.1.1_U1.]) diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 index 5838a0d329..89cca67ea6 100644 --- a/m4/strnlen.m4 +++ b/m4/strnlen.m4 @@ -1,5 +1,5 @@ -# strnlen.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# strnlen.m4 serial 2 +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -17,6 +17,8 @@ AC_DEFUN([gl_FUNC_STRNLEN], # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. #AC_LIBOBJ(strnlen) + AC_DEFINE(strnlen, rpl_strnlen, + [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi ]) diff --git a/m4/strtod.m4 b/m4/strtod.m4 index 19afb13bb1..809a83fa80 100644 --- a/m4/strtod.m4 +++ b/m4/strtod.m4 @@ -1,5 +1,5 @@ -# strtod.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# strtod.m4 serial 2 +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_STRTOD], [ AC_REQUIRE([AC_FUNC_STRTOD]) if test $ac_cv_func_strtod = no; then + AC_DEFINE(strtod, rpl_strtod, + [Define to rpl_strtod if the replacement function should be used.]) gl_PREREQ_STRTOD fi ]) diff --git a/m4/utime.m4 b/m4/utime.m4 index 9767f941eb..e3a159fafa 100644 --- a/m4/utime.m4 +++ b/m4/utime.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl From Jim Meyering dnl Replace the utime function on systems that need it. @@ -10,6 +10,8 @@ AC_DEFUN([jm_FUNC_UTIME], AC_REQUIRE([AC_FUNC_UTIME_NULL]) if test $ac_cv_func_utime_null = no; then AC_LIBOBJ(utime) + AC_DEFINE(utime, rpl_utime, + [Define to rpl_utime if the replacement function should be used.]) gl_PREREQ_UTIME fi ])