changeset 4229:c7ddde35beec

Make this module usable in shared libraries.
author Bruno Haible <bruno@clisp.org>
date Fri, 31 Jan 2003 15:47:03 +0000
parents b9f496cbd977
children 82a9d184cc00
files lib/ChangeLog lib/rename.c lib/strnlen.c m4/ChangeLog m4/rename.m4 m4/strnlen.m4 m4/strtod.m4 m4/utime.m4
diffstat 8 files changed, 42 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-31  Bruno Haible  <bruno@clisp.org>
+
+	* rename.c: #undef rename before defining rpl_rename.
+	* strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
+
 2003-01-30  Bruno Haible  <bruno@clisp.org>
 
 	* printf-args.h: New file, from GNU gettext.
--- 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 <config.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#undef rename
+
 #include <stdio.h>
 #if HAVE_STDLIB_H
 # include <stdlib.h>
--- 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 <config.h>
 #endif
+#undef strnlen
 
 #if HAVE_STRING_H
 # if !STDC_HEADERS && HAVE_MEMORY_H
 #  include <memory.h>
 # 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 <string.h>
-# undef strnlen
 #else
 # include <strings.h>
 #endif
@@ -44,6 +41,10 @@
 #undef __strnlen
 #undef strnlen
 
+#ifndef _LIBC
+# define strnlen rpl_strnlen
+#endif
+
 #ifndef weak_alias
 # define __strnlen strnlen
 #endif
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,14 @@
+2003-01-31  Bruno Haible  <bruno@clisp.org>
+
+	* 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  <bruno@clisp.org>
 
 	* signed.m4: New file, from GNU gettext.
--- 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 @@
   ])
   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.])
--- 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 @@
     # 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
 ])
--- 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_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
 ])
--- 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_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
 ])