Make this module usable in shared libraries.
authorBruno Haible <bruno@clisp.org>
Fri, 31 Jan 2003 15:47:03 +0000 (15:47 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 31 Jan 2003 15:47:03 +0000 (15:47 +0000)
lib/ChangeLog
lib/rename.c
lib/strnlen.c
m4/ChangeLog
m4/rename.m4
m4/strnlen.m4
m4/strtod.m4
m4/utime.m4

index 6d69f196a8a51eb12d0f75dc532b4cdac06e2d03..9bc4367532ed5e2b44cbb7ac2de8db959ea77ac7 100644 (file)
@@ -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.
index 70ff13018ba5aeacfb58befe6c49b917e355e3bd..4a4c165b2c554a1bccb050f77a59c62442b8eb64 100644 (file)
@@ -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
 
 /* 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>
index b6c710269cd50d9ec6c18d33df3b27ff72b8908c..e7ad6d2f0662ea73720ddd7e2832b4a4499f26e0 100644 (file)
@@ -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
 #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 @@ char *memchr ();
 #undef __strnlen
 #undef strnlen
 
+#ifndef _LIBC
+# define strnlen rpl_strnlen
+#endif
+
 #ifndef weak_alias
 # define __strnlen strnlen
 #endif
index d1b76c7a8c9c2b8a654905a303c9a4fc7549cab4..92336bdccf7995cb95f541a261ce2979e9011b55 100644 (file)
@@ -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.
index 5c1e1ced06dbd9e7eaeb1e7dbc12cd15a0abdc14..a2e0d74fd6f93dd3cef06f2b1613cd5f4e29462e 100644 (file)
@@ -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.])
index 5838a0d32943e28158a638152452b5fa7c82c91a..89cca67ea6c6415ccfd7ad45609a3b0f83bcc38c 100644 (file)
@@ -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
 ])
index 19afb13bb138745e1ca2e6e967e2a5da8bf0093f..809a83fa808ad36d82beeebdc4fd5dbd2f8af793 100644 (file)
@@ -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
 ])
index 9767f941eb14ca96982b95c90e9ec5547b8d1c7c..e3a159fafa1ba078b1b9dd33ff1f8c0561f18acf 100644 (file)
@@ -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
 ])