changeset 20218:e755bf735375

new version from FSF
author Jim Meyering <jim@meyering.net>
date Fri, 15 Dec 1995 15:35:15 +0000
parents 2f0bb67a9521
children 43e8dacb8795
files lib/error.c lib/strtol.c
diffstat 2 files changed, 27 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lib/error.c	Fri Dec 15 15:34:07 1995 +0000
+++ b/lib/error.c	Fri Dec 15 15:35:15 1995 +0000
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#if HAVE_VPRINTF || HAVE_DOPRNT
+#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
 # if __STDC__
 #  include <stdarg.h>
 #  define VA_START(args, lastarg) va_start(args, lastarg)
@@ -36,7 +36,7 @@
 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
 #endif
 
-#if STDC_HEADERS
+#if STDC_HEADERS || _LIBC
 # include <stdlib.h>
 # include <string.h>
 #else
@@ -51,11 +51,15 @@
    function without parameters instead.  */
 void (*error_print_progname) () = NULL;
 
+#ifdef _LIBC
+#define program_name program_invocation_name
+#endif
+
 /* The calling program should define program_name and set it to the
    name of the executing program.  */
 extern char *program_name;
 
-#if HAVE_STRERROR
+#if HAVE_STRERROR || _LIBC
 # ifndef strerror		/* On some systems, strerror is a macro */
 char *strerror ();
 # endif
@@ -105,7 +109,7 @@
 
 #ifdef VA_START
   VA_START (args, message);
-# if HAVE_VPRINTF
+# if HAVE_VPRINTF || _LIBC
   vfprintf (stderr, message, args);
 # else
   _doprnt (message, args, stderr);
--- a/lib/strtol.c	Fri Dec 15 15:34:07 1995 +0000
+++ b/lib/strtol.c	Fri Dec 15 15:35:15 1995 +0000
@@ -1,21 +1,22 @@
 /* Copyright (C) 1991, 1992, 1994, 1995 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@prep.ai.mit.edu.
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to bug-glibc@prep.ai.mit.edu.
 
-   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 the
-   Free Software Foundation; either version 2, or (at your option) any
-   later version.
+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 the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -33,7 +34,7 @@
 extern int errno;
 #endif
 
-#if HAVE_LIMITS_H
+#ifdef HAVE_LIMITS_H
 # include <limits.h>
 #endif
 
@@ -277,10 +278,6 @@
 
 /* External user entry point.  */
 
-#ifdef weak_symbol
-weak_symbol (strtol)
-#endif
-
 INT
 strtol (nptr, endptr, base)
      const char *nptr;
@@ -289,3 +286,7 @@
 {
   return INTERNAL (strtol) (nptr, endptr, base, 0);
 }
+
+#ifdef weak_symbol
+weak_symbol (strtol)
+#endif