changeset 5584:f43f068c9228

Move some conditionals from the .c file to the .m4 file.
author Bruno Haible <bruno@clisp.org>
date Mon, 17 Jan 2005 13:15:19 +0000
parents 5c8e3fc4efe4
children adff74659d81
files lib/ChangeLog lib/stpncpy.c m4/ChangeLog m4/stpncpy.m4
diffstat 4 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-06  Bruno Haible  <bruno@clisp.org>
+
+	* stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
+	because stpncpy.m4 takes care of it.
+
 2004-01-24  Bruno Haible  <bruno@clisp.org>
 
 	* progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
--- a/lib/stpncpy.c
+++ b/lib/stpncpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-1997, 2002-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-1997, 2002-2003, 2005 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.
@@ -27,15 +27,6 @@
 /* Specification.  */
 #include "stpncpy.h"
 
-#if !HAVE_STPNCPY
-
-#ifndef _LIBC
-/* 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
 # define __stpncpy stpncpy
 #endif
@@ -102,5 +93,3 @@
 #ifdef weak_alias
 weak_alias (__stpncpy, stpncpy)
 #endif
-
-#endif
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-06  Bruno Haible  <bruno@clisp.org>
+
+	* stpncpy.m4 (gl_FUNC_STPNCPY): Rename stpncpy to gnu_stpncpy here.
+
 2005-01-04  Jim Meyering  <jim@meyering.net>
 
 	Changes imported from coreutils.
--- a/m4/stpncpy.m4
+++ b/m4/stpncpy.m4
@@ -1,5 +1,5 @@
-# stpncpy.m4 serial 1
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# stpncpy.m4 serial 2
+dnl Copyright (C) 2002-2003, 2005 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
@@ -51,6 +51,8 @@
     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