about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-09-21 01:47:02 +0000
committerUlrich Drepper <drepper@redhat.com>1997-09-21 01:47:02 +0000
commit2604afb1b2d9acc3c70b1214285f996200bf0358 (patch)
treeba59d75147565b8ab19686d98cee368d8ec697fc /stdlib
parent4547c1a410fbc3ab5592a68bac1661135d91983f (diff)
downloadglibc-2604afb1b2d9acc3c70b1214285f996200bf0358.tar.gz
glibc-2604afb1b2d9acc3c70b1214285f996200bf0358.tar.xz
glibc-2604afb1b2d9acc3c70b1214285f996200bf0358.zip
1997-09-21 03:19  Ulrich Drepper  <drepper@cygnus.com>

	* libio/libio.h: More libstdc++ cleanups.  Define _IO_USE_DTOA if
	_G_HAVE_PRINTF_FP is not defined.
	* libio/strops.c: Undo patch of 1997-07-08 02:18.  Must find a
	different solution for the problem.

	* misc/search.h [__USE_GNU]: Define comparison_fn_t.
	* stdlib/stdlib.h: Define comparison_fn_t only if __COMPAR_FN_T is
	not defined.
	Fix typo.  Pretty print inline functions.

	* sysdeps/i386/i486/string.h (__stpcpy_small): Increment __cp not cp.
	Patch by HJ Lu <hjl@gnu.ai.mit.edu>.

1997-09-20 16:45  Ulrich Drepper  <drepper@cygnus.com>

	* hesiod/hesiod.c (hesiod_init): Use __secure_getenv to get
	HES_DOMAIN environment variable.
	Suggested by Mark Kettenis <kettenis@phys.uva.nl>.

	* hesiod/README.hesiod: A bit of information about Hesiod and how
	to use it.  Written by Mark Kettenis <kettenis@phys.uva.nl>.

1997-09-20 05:15  Ulrich Drepper  <drepper@cygnus.com>

	* manual/maint.texi: Update requirement list.

	* io/ftw.h: Don't use parameter names from global namespace in
	prototypes.

	* stdlib/strtol.c: If used outside glibc handle broken systems
	which have character classification functions which are not 8-bit
	clean gracefully.  Patch by Bruno Haible <haible@ilog.fr>.

1997-09-19 21:42  David S. Miller  <davem@tanya.rutgers.edu>

	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: ssize_t is
	a long long int.

1997-09-19 15:12  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* posix/Makefile (test-srcs): New, set to globtest.

1997-09-20 00:24  Ulrich Drepper  <drepper@cygnus.com>

	* manual/filesys.texi: Document ftw, nftw and needed data types.

1997-09-19 12:53  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* sysdeps/i386/i486/bits/string.h: Fix typo.

1997-09-19 14:11  Ulrich Drepper  <drepper@cygnus.com>

	* io/ftwtest.c (cb): Print level.
	* io/ftwtest-sh: Updated for ftwtest.c change.

	* string/argz.h (__argz_next): Cast NULL to char * to satisfy C++
	compilers.
	Reported by Mirko Streckenbach <mirko@ramz.ing.tu-bs.de>.

	* catgets/catgets.c (catopen): Correctly allocate string of nlspath.
	Reported by Charles C. Fu <ccwf@klab.caltech.edu>.

1997-09-18 13:30  Klaus Espenlaub  <kespenla@student.informatik.uni-ulm.de>

	* sysdeps/i386/init-first.c: Call __getopt_clean_environment with
	additional argument.
	* sysdeps/mach/hurd/i386/init-first.c: Likewise.
	* sysdeps/mach/hurd/mips/init-first.c: Likewise.
	* sysdeps/stub/init-first.c: Likewise.

1997-09-18 03:16  Ulrich Drepper  <drepper@cygnus.com>

	* manual/search.texi: Document lsearch, lfind, the hsearch and
	tsearch functions.

1997-09-18 00:04  Ulrich Drepper  <drepper@cygnus.com>

	* misc/hsearch_r.c (hsearch_r): Only return error for ENTER action
	if the table is full and we *really* have to enter a new entry.

1997-09-17 19:44  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Get rid
	of hack for handling flush opcode.
	Patch by Richard Henderson <rth@cygnus.com>.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/stdlib.h159
-rw-r--r--stdlib/strtol.c11
2 files changed, 105 insertions, 65 deletions
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 7963cb6fec..a92df4bc9e 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -210,58 +210,90 @@ extern unsigned long long int __strtoull_internal __P ((__const char *
 #if defined __OPTIMIZE__ && __GNUC__ >= 2
 /* Define inline functions which call the internal entry points.  */
 
-extern __inline double strtod (__const char *__restrict __nptr,
-			       char **__restrict __endptr)
-{ return __strtod_internal (__nptr, __endptr, 0); }
-extern __inline long int strtol (__const char *__restrict __nptr,
-				 char **__restrict __endptr, int __base)
-{ return __strtol_internal (__nptr, __endptr, __base, 0); }
-extern __inline unsigned long int strtoul (__const char *__restrict __nptr,
-					   char **__restrict __endptr,
-					   int __base)
-{ return __strtoul_internal (__nptr, __endptr, __base, 0); }
-
-#ifdef __USE_GNU
-extern __inline float strtof (__const char *__restrict __nptr,
-			      char **__restrict __endptr)
-{ return __strtof_internal (__nptr, __endptr, 0); }
-extern __inline __long_double_t strtold (__const char *__restrict __nptr,
-					 char **__restrict __endptr)
-{ return __strtold_internal (__nptr, __endptr, 0); }
-#endif
-
-#ifdef __USE_BSD
-extern __inline long long int strtoq (__const char *__restrict __nptr,
-				      char **__restrict __endptr, int __base)
-{ return __strtoll_internal (__nptr, __endptr, __base, 0); }
-extern __inline unsigned long long int strtouq (__const char *__restrict __nptr,
-						char **__restrict __endptr,
-						int __base)
-{ return __strtoull_internal (__nptr, __endptr, __base, 0); }
-#endif
-
-#if defined __USE_MISC || defined __USE_ISOC9X
-extern __inline long long int strtoll (__const char *__restrict __nptr,
-				       char **__restrict __endptr, int __base)
-{ return __strtoll_internal (__nptr, __endptr, __base, 0); }
-extern __inline unsigned long long int strtoull (__const char *
-						 __restrict __nptr,
-						 char **__restrict __endptr,
-						 int __base)
-{ return __strtoull_internal (__nptr, __endptr, __base, 0); }
-#endif
-
-extern __inline double atof (__const char *__nptr)
-{ return strtod (__nptr, (char **) NULL); }
-extern __inline int atoi (__const char *__nptr)
-{ return (int) strtol (__nptr, (char **) NULL, 10); }
-extern __inline long int atol (__const char *__nptr)
-{ return strtol (__nptr, (char **) NULL, 10); }
-
-#if defined __USE_MISC || defined __USE_ISOC9X
-extern __inline long long int atoll (__const char *__nptr)
-{ return strtoll (__nptr, (char **) NULL, 10); }
-#endif
+extern __inline double
+strtod (__const char *__restrict __nptr, char **__restrict __endptr)
+{
+  return __strtod_internal (__nptr, __endptr, 0);
+}
+extern __inline long int
+strtol (__const char *__restrict __nptr, char **__restrict __endptr,
+	int __base)
+{
+  return __strtol_internal (__nptr, __endptr, __base, 0);
+}
+extern __inline unsigned long int
+strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base)
+{
+  return __strtoul_internal (__nptr, __endptr, __base, 0);
+}
+
+# ifdef __USE_GNU
+extern __inline float
+strtof (__const char *__restrict __nptr, char **__restrict __endptr)
+{
+  return __strtof_internal (__nptr, __endptr, 0);
+}
+extern __inline __long_double_t
+strtold (__const char *__restrict __nptr, char **__restrict __endptr)
+{
+  return __strtold_internal (__nptr, __endptr, 0);
+}
+# endif
+
+# ifdef __USE_BSD
+extern __inline long long int
+strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
+	int __base)
+{
+  return __strtoll_internal (__nptr, __endptr, __base, 0);
+}
+extern __inline unsigned long long int
+strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base)
+{
+  return __strtoull_internal (__nptr, __endptr, __base, 0);
+}
+# endif
+
+# if defined __USE_MISC || defined __USE_ISOC9X
+extern __inline long long int
+strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base)
+{
+  return __strtoll_internal (__nptr, __endptr, __base, 0);
+}
+extern __inline unsigned long long int
+strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
+	  int __base)
+{
+  return __strtoull_internal (__nptr, __endptr, __base, 0);
+}
+# endif
+
+extern __inline double
+atof (__const char *__nptr)
+{
+  return strtod (__nptr, (char **) NULL);
+}
+extern __inline int
+atoi (__const char *__nptr)
+{
+  return (int) strtol (__nptr, (char **) NULL, 10);
+}
+extern __inline long int
+atol (__const char *__nptr)
+{
+  return strtol (__nptr, (char **) NULL, 10);
+}
+
+# if defined __USE_MISC || defined __USE_ISOC9X
+extern __inline long long int
+atoll (__const char *__nptr)
+{
+  return strtoll (__nptr, (char **) NULL, 10);
+}
+# endif
 #endif /* Optimizing GCC >=2.  */
 
 
@@ -304,7 +336,7 @@ extern __ptr_t __setstate __P ((__ptr_t __statebuf));
 extern __ptr_t setstate __P ((__ptr_t __statebuf));
 
 
-#ifdef __USE_MISC
+# ifdef __USE_MISC
 /* Reentrant versions of the `random' family of functions.
    These functions all use the following data structure to contain
    state, rather than global state variables.  */
@@ -333,7 +365,7 @@ extern int initstate_r __P ((unsigned int __seed, __ptr_t __statebuf,
 
 extern int __setstate_r __P ((__ptr_t __statebuf, struct random_data *__buf));
 extern int setstate_r __P ((__ptr_t __statebuf, struct random_data *__buf));
-#endif	/* Use misc.  */
+# endif	/* Use misc.  */
 #endif	/* Use SVID || extended X/Open.  */
 
 
@@ -441,7 +473,7 @@ extern void cfree __P ((__ptr_t __ptr));
 #endif /* Use misc.  */
 
 #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC
-#include <alloca.h>
+# include <alloca.h>
 #endif /* Use GNU, BSD, or misc.  */
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -545,12 +577,12 @@ extern char *realpath __P ((__const char *__name, char *__resolved));
 
 /* Shorthand for type of comparison functions.  */
 #ifndef __COMPAR_FN_T
-#define __COMPAR_FN_T
+# define __COMPAR_FN_T
 typedef int (*__compar_fn_t) __P ((__const __ptr_t, __const __ptr_t));
-#endif
 
-#ifdef	__USE_GNU
+# ifdef	__USE_GNU
 typedef __compar_fn_t comparison_fn_t;
+# endif
 #endif
 
 /* Do a binary search for KEY in BASE, which consists of NMEMB elements
@@ -568,7 +600,7 @@ extern void qsort __P ((__ptr_t __base, size_t __nmemb, size_t __size,
 /* Return the absolute value of X.  */
 extern int abs __P ((int __x)) __attribute__ ((__const__));
 extern long int labs __P ((long int __x)) __attribute__ ((__const__));
-#if defined __USE_ISOC9X
+#ifdef __USE_ISOC9X
 extern long long int llabs __P ((long long int __x))
      __attribute__ ((__const__));
 #endif
@@ -643,8 +675,11 @@ extern int mbtowc __P ((wchar_t *__restrict __pwc,
 extern int wctomb __P ((char *__s, wchar_t __wchar));
 
 #if defined __OPTIMIZE__ && __GNUC__ >= 2
-extern __inline int mblen (__const char *__s, size_t __n)
-{ return mbtowc ((wchar_t *) NULL, __s, __n); }
+extern __inline int
+mblen (__const char *__s, size_t __n)
+{
+  return mbtowc ((wchar_t *) NULL, __s, __n);
+}
 #endif /* Optimizing GCC >=2.  */
 
 
@@ -671,7 +706,7 @@ extern int rpmatch __P ((__const char *__response));
    optional value introduced by an equal sign.  If the suboption is
    not part of TOKENS return in *VALUEP beginning of unknown
    suboption.  On exit *OPTIONP is set to the beginning of the next
-   otken or at the terminating NUL character.  */
+   token or at the terminating NUL character.  */
 extern int getsubopt __P ((char **__optionp, __const char *__const *__tokens,
 			   char **__valuep));
 #endif
diff --git a/stdlib/strtol.c b/stdlib/strtol.c
index 97ad23453b..19e4a52880 100644
--- a/stdlib/strtol.c
+++ b/stdlib/strtol.c
@@ -184,6 +184,11 @@ extern int errno;
 #  define TOUPPER(Ch) towupper (Ch)
 # endif
 # else
+#  if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
+#   define IN_CTYPE_DOMAIN(c) 1
+#  else
+#   define IN_CTYPE_DOMAIN(c) isascii(c)
+#  endif
 #  define L_(Ch) Ch
 #  define UCHAR_TYPE unsigned char
 #  define STRING_TYPE char
@@ -192,9 +197,9 @@ extern int errno;
 #  define ISALPHA(Ch) __isalpha_l ((Ch), loc)
 #  define TOUPPER(Ch) __toupper_l ((Ch), loc)
 # else
-#  define ISSPACE(Ch) isspace (Ch)
-#  define ISALPHA(Ch) isalpha (Ch)
-#  define TOUPPER(Ch) toupper (Ch)
+#  define ISSPACE(Ch) (IN_CTYPE_DOMAIN (Ch) && isspace (Ch))
+#  define ISALPHA(Ch) (IN_CTYPE_DOMAIN (Ch) && isalpha (Ch))
+#  define TOUPPER(Ch) (IN_CTYPE_DOMAIN (Ch) ? toupper (Ch) : (Ch))
 # endif
 #endif