* misc/libgen.h: Don't take basename macro as taking arguments.

	* sysdeps/arm/bits/huge_val.h: Use hexadecimal floating-point constants
	for gcc >= 2.95.
	* sysdeps/i386/bits/huge_val.h: Likewise.
	* sysdeps/i386/bits/huge_val.h: Likewise.
	* sysdeps/ieee754/bits/huge_val.h: Likewise.
	* sysdeps/m68k/bits/huge_val.h: Likewise.
	* sysdeps/sparc/sparc32/fpu/bits/huge_val.h: Likewise.
	* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Likewise.
This commit is contained in:
Ulrich Drepper 1999-08-24 20:40:44 +00:00
parent da1067a915
commit 52cf7d345d
27 changed files with 235 additions and 88 deletions

View File

@ -1,5 +1,16 @@
1999-08-24 Ulrich Drepper <drepper@cygnus.com>
* misc/libgen.h: Don't take basename macro as taking arguments.
* sysdeps/arm/bits/huge_val.h: Use hexadecimal floating-point constants
for gcc >= 2.95.
* sysdeps/i386/bits/huge_val.h: Likewise.
* sysdeps/i386/bits/huge_val.h: Likewise.
* sysdeps/ieee754/bits/huge_val.h: Likewise.
* sysdeps/m68k/bits/huge_val.h: Likewise.
* sysdeps/sparc/sparc32/fpu/bits/huge_val.h: Likewise.
* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Likewise.
* conform/Makefile: New file.
* conform/conformtest.pl: New file.
* conform/data/aio.h-data: New file.

View File

@ -1,10 +1,12 @@
#! /usr/bin/perl
$CC = "gcc";
$CFLAGS = "-I. -D_XOPEN_SOURCE=500";
$CFLAGS = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=500";
# List of the headers we are testing.
@headers = ("fmtmsg.h", "float.h", "fcntl.h", "errno.h", "dlfcn.h", "dirent.h",
@headers = ("math.h", "locale.h", "libgen.h", "langinfo.h", "iso646.h",
"inttypes.h", "iconv.h", "grp.h", "glob.h", "ftw.h", "fnmatch.h",
"fmtmsg.h", "float.h", "fcntl.h", "errno.h", "dlfcn.h", "dirent.h",
"ctype.h", "cpio.h", "assert.h", "aio.h");
# These are the ISO C9x keywords.
@ -341,7 +343,7 @@ while ($#headers >= 0) {
# Generate a program to test for availability of this function.
open (TESTFILE, ">$fnamebase.c");
print TESTFILE "#include <$h>\n";
print TESTFILE "#undef $fname\n";
# print TESTFILE "#undef $fname\n";
print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
close (TESTFILE);
@ -351,7 +353,7 @@ while ($#headers >= 0) {
# Generate a program to test for the type of this function.
open (TESTFILE, ">$fnamebase.c");
print TESTFILE "#include <$h>\n";
print TESTFILE "#undef $fname\n";
# print TESTFILE "#undef $fname\n";
print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
close (TESTFILE);

View File

@ -1 +1,3 @@
macro assert
allow *_t

View File

@ -19,5 +19,8 @@ constant C_ISCHR 0020000
constant C_ISCTG 0110000
constant C_ISLNK 0120000
constant C_ISSOCK 0140000
# XXX We should be able to test a constant string content here.
constant MAGIC
allow *_t
#endif

View File

@ -19,7 +19,9 @@ function int _toupper (int)
function int _tolower (int)
# The following is not entirely correct. It should be is[a-z]* but the
# replacement fnmatch implementation doesn't grok it.
# replacement fnmatch implementation does not grok it.
allow is*
allow to*
allow *_t
#endif

View File

@ -9,7 +9,7 @@ element {struct dirent} char d_name []
type ino_t
function int closedir (DIR*)
function DIR* opendir (const char*)
function {DIR*} opendir (const char*)
function {struct dirent*} readdir (DIR*)
function int readdir_r (DIR*, struct dirent*, struct dirent**)
function void rewinddir (DIR*)
@ -17,4 +17,5 @@ function void seekdir (DIR*, long int)
function {long int} telldir (DIR*)
allow d_*
allow *_t
#endif

View File

@ -8,4 +8,6 @@ function {void*} dlopen (const char*, int)
function {void*} dlsym (void *, const char*)
function int dlclose (void*)
function {char*} dlerror (void)
allow *_t
#endif

View File

@ -37,3 +37,5 @@ macro LDBL_EPSILON
macro FLT_MIN
macro DBL_MIN
macro LDBL_MIN
allow *_t

View File

@ -57,4 +57,6 @@ macro MM_NOMSG
macro MM_NOCON
function int fmtmsg (long, const char*, int, const char*, const char*, const char*)
allow *_t
#endif

View File

@ -6,4 +6,6 @@ constant FNM_NOESCAPE
constant FNM_NOSYS
function int fnmatch (const char*, const char*, int)
allow *_t
#endif

View File

@ -18,4 +18,6 @@ macro FTW_CHDIR
function int ftw (const char*, int (*) (const char *, const struct stat*, int), int)
function int nftw (const char*, int (*) (const char *, const struct stat*, int, FTW *), int, int)
allow *_t
#endif

View File

@ -5,7 +5,7 @@ element glob_t {char**} gl_pathv
element glob_t size_t gl_offs
constant GLOB_APPEND
constant GLOB_DOOFS
constant GLOB_DOOFFS
constant GLOB_ERR
constant GLOB_MARK
constant GLOB_NOCHECK
@ -18,8 +18,9 @@ constant GLOB_NOSPACE
constant GLOB_NOSYS
function int glob (const char*, int, int (*) (const char*, int), glob_t*)
function void globfree (glob_t)
function void globfree (glob_t *)
allow gl_*
allow GLOB_*
allow *_t
#endif

View File

@ -18,5 +18,6 @@ function void endgrent (void)
function void setgrent (void)
# endif
allow gr_
allow gr_*
allow *_t
#endif

View File

@ -4,4 +4,6 @@ type iconv_t
function iconv_t iconv_open (const char*, const char*)
function size_t iconv (iconv_t, char**, size_t*, char**, size_t*)
function int iconv_close (iconv_t)
allow *_t
#endif

View File

@ -11,3 +11,4 @@ type uintptr_t
allow PRI*
allow SCN*
allow *_t

View File

@ -9,3 +9,5 @@ macro or
macro or_eq
macro xor
macro xor_eq
allow *_t

View File

@ -58,4 +58,6 @@ constant CRNCYSTR
function {char*} nl_langinfo (nl_item)
allow-header nl_types.h
allow *_t
#endif

View File

@ -1,4 +1,6 @@
#if !defined ISO && !defined POSIX
function {char*} basename (char*)
function {char*} dirname (char*)
allow *_t
#endif

View File

@ -15,7 +15,7 @@ element {struct lconv} char n_sign_posn
element {struct lconv} {char*} positive_sign
element {struct lconv} char p_cs_precedes
element {struct lconv} char p_sep_by_space
element {struct lconv} char p_sign_pos
element {struct lconv} char p_sign_posn
element {struct lconv} {char*} thousands_sep
constant NULL
@ -28,7 +28,8 @@ macro LC_MONETARY
macro LC_NUMERIC
macro LC_TIME
function {struct lconv*) localeconv (void)
function {struct lconv*} localeconv (void)
function {char*} setlocale (int, const char*)
allow LC_*
allow *_t

View File

@ -15,6 +15,7 @@ constant M_SQRT1_2
constant MAXFLOAT
constant HUGE_VAL
#endif
function double acos (double)
function double asin (double)
@ -43,11 +44,11 @@ function double gamma (double)
function double hypot (double, double)
function double j0 (double)
function double j1 (double)
function double jn (double)
function double jn (int, double)
function double lgamma (double)
function double y0 (double)
function double y1 (double)
function double yn (double)
function double yn (int, double)
function int isnan (double)
function double acosh (double)
function double asinh (double)
@ -156,3 +157,5 @@ allow nextafterl
allow remainderl
allow rintl
allow scalbl
allow *_t

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1996, 1997, 1999 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
@ -33,7 +33,7 @@ extern char *dirname __P ((char *__path));
<string.h>) and only if this header is included make the XPG
version available under the real name. */
extern char *__xpg_basename __P ((char *__path));
#define basename(path) __xpg_basename (path)
#define basename __xpg_basename
__END_DECLS

View File

@ -1,7 +1,7 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
ARM version.
Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1992, 95, 96, 97, 98, 99 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
@ -29,11 +29,19 @@
#ifdef __GNUC__
# define HUGE_VAL \
# if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x000000007ff00000ULL }).__d)
# endif
#else /* not GCC */
# include <endian.h>
@ -59,11 +67,19 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
# ifdef __GNUC__
# define HUGE_VALF \
# if __GNUC_PREREQ(2,95)
# define HUGE_VALF (0x1.0p255f)
# else
# define HUGE_VALF \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7f800000UL }).__d)
# endif
# else /* not GCC */
typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;

View File

@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for ix86 (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1992, 1995, 1996, 1997, 1999 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
@ -26,43 +26,56 @@
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
#if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
#else
# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
#define __huge_val_t union { unsigned char __c[8]; double __d; }
#ifdef __GNUC__
# define HUGE_VAL (__extension__ \
# define __huge_val_t union { unsigned char __c[8]; double __d; }
# ifdef __GNUC__
# define HUGE_VAL (__extension__ \
((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
#else /* Not GCC. */
# else /* Not GCC. */
static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
# define HUGE_VAL (__huge_val.__d)
#endif /* GCC. */
# define HUGE_VAL (__huge_val.__d)
# endif /* GCC. */
#endif /* GCC 2.95 */
/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
#ifdef __USE_ISOC9X
# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
# if __GNUC_PREREQ(2,95)
# define __huge_valf_t union { unsigned char __c[4]; float __f; }
# ifdef __GNUC__
# define HUGE_VALF (__extension__ \
# define HUGE_VALF (0x1.0p255f)
# define HUGE_VALL (0x1.0p32767L)
# else
# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
# define __huge_valf_t union { unsigned char __c[4]; float __f; }
# ifdef __GNUC__
# define HUGE_VALF (__extension__ \
((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
# else /* Not GCC. */
# else /* Not GCC. */
static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
# define HUGE_VALF (__huge_valf.__f)
# endif /* GCC. */
# define HUGE_VALF (__huge_valf.__f)
# endif /* GCC. */
# define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
# define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
# define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
# ifdef __GNUC__
# define HUGE_VALL (__extension__ \
# define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
# ifdef __GNUC__
# define HUGE_VALL (__extension__ \
((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
# else /* Not GCC. */
# else /* Not GCC. */
static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
# define HUGE_VALL (__huge_vall.__ld)
# endif /* GCC. */
# define HUGE_VALL (__huge_vall.__ld)
# endif /* GCC. */
# endif /* GCC 2.95 */
#endif /* __USE_ISOC9X. */

View File

@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1992, 1995, 1996, 1997, 1999 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
@ -28,11 +28,19 @@
#ifdef __GNUC__
# define HUGE_VAL \
# if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
# endif
#else /* not GCC */
# include <endian.h>
@ -58,11 +66,19 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
# ifdef __GNUC__
# define HUGE_VALF \
# if __GNUC_PREREQ(2,95)
# define HUGE_VALF (0x1.0p255f)
# else
# define HUGE_VALF \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7f800000UL }).__d)
# endif
# else /* not GCC */
typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;

View File

@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for m68k (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1992, 1995, 1996, 1997, 1999 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
@ -30,11 +30,19 @@
#ifdef __GNUC__
# define HUGE_VAL \
# if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned long long __l; double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
# endif
#else /* not GCC */
static union { unsigned char __c[8]; double __d; } __huge_val =
@ -48,28 +56,37 @@ static union { unsigned char __c[8]; double __d; } __huge_val =
#ifdef __USE_ISOC9X
# ifdef __GNUC__
# if __GNUC_PREREQ(2,95)
# define HUGE_VALF \
# define HUGE_VALF (0x1.0p255f)
# define HUGE_VALL (0x1.0p32767L)
# else
# ifdef __GNUC__
# define HUGE_VALF \
(__extension__ \
((union { unsigned long __l; float __f; }) \
{ __l: 0x7f800000UL }).__f)
# define HUGE_VALL \
# define HUGE_VALL \
(__extension__ \
((union { unsigned long __l[3]; long double __ld; }) \
{ __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
# else /* not GCC */
# else /* not GCC */
static union { unsigned char __c[4]; float __f; } __huge_valf =
{ { 0x7f, 0x80, 0, 0 } };
# define HUGE_VALF (__huge_valf.__f)
# define HUGE_VALF (__huge_valf.__f)
static union { unsigned char __c[12]; long double __ld; } __huge_vall =
{ { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
# define HUGE_VALL (__huge_vall.__ld)
# define HUGE_VALL (__huge_vall.__ld)
# endif /* GCC. */
# endif /* GCC. */
# endif /* GCC 2.95. */
#endif /* __USE_ISOC9X. */

View File

@ -29,11 +29,19 @@
#ifdef __GNUC__
# define HUGE_VAL \
# if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
# endif
#else /* not GCC */
typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
@ -50,51 +58,60 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
#ifdef __USE_ISOC9X
# ifdef __GNUC__
# if __GNUC_PREREQ(2,95)
# define HUGE_VALF \
# define HUGE_VALF (0x1.0p255)
# define HUGE_VALL (0x1.0p32767)
# else
# ifdef __GNUC__
# define HUGE_VALF \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7f800000UL }).__d)
# else /* not GCC */
# else /* not GCC */
typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
# define HUGE_VALF (__huge_valf.__f)
# define HUGE_VALF (__huge_valf.__f)
# endif /* GCC. */
# endif /* GCC. */
#if __WORDSIZE == 32
# if __WORDSIZE == 32
/* Sparc32 has IEEE 754 64bit long double */
# define HUGE_VALL HUGE_VAL
# define HUGE_VALL HUGE_VAL
#else
# else
/* Sparc64 uses IEEE 754 128bit long double */
#ifdef __GNUC__
# ifdef __GNUC__
# define HUGE_VALL \
# define HUGE_VALL \
(__extension__ \
((union { struct { unsigned long __h, __l; } __i; long double __d; }) \
{ __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
#else /* not GCC */
# else /* not GCC */
typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t;
# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
# define HUGE_VALL (__huge_vall.__d)
# define HUGE_VALL (__huge_vall.__d)
#endif /* GCC. */
# endif /* GCC. */
#endif
# endif
# endif /* GCC 2.95. */
#endif /* __USE_ISOC9X. */

View File

@ -29,11 +29,19 @@
#ifdef __GNUC__
# define HUGE_VAL \
# if __GNUC_PREREQ(2,95)
# define HUGE_VAL (0x1.0p2047)
# else
# define HUGE_VAL \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
# endif
#else /* not GCC */
typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
@ -50,51 +58,65 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
#ifdef __USE_ISOC9X
# ifdef __GNUC__
# if __GNUC_PREREQ(2,95)
# define HUGE_VALF \
# define HUGE_VALF (0x1.0p255f)
# if __WORDSIZE == 32
# define HUGE_VALL HUGE_VAL
# else
/* Sparc64 uses IEEE 754 128bit long double */
# define HUGE_VALL (0x1.0p32767L)
# endif
# else
# ifdef __GNUC__
# define HUGE_VALF \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7f800000UL }).__d)
# else /* not GCC */
# else /* not GCC */
typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
# define HUGE_VALF (__huge_valf.__f)
# define HUGE_VALF (__huge_valf.__f)
# endif /* GCC. */
# endif /* GCC. */
#if __WORDSIZE == 32
# if __WORDSIZE == 32
/* Sparc32 has IEEE 754 64bit long double */
# define HUGE_VALL HUGE_VAL
# define HUGE_VALL HUGE_VAL
#else
# else
/* Sparc64 uses IEEE 754 128bit long double */
#ifdef __GNUC__
# ifdef __GNUC__
# define HUGE_VALL \
# define HUGE_VALL \
(__extension__ \
((union { struct { unsigned long __h, __l; } __i; long double __d; }) \
{ __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
#else /* not GCC */
# else /* not GCC */
typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t;
# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
# define __HUGE_VALL_bytes { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
# define HUGE_VALL (__huge_vall.__d)
# define HUGE_VALL (__huge_vall.__d)
#endif /* GCC. */
# endif /* GCC. */
#endif
# endif
# endif /* GCC 2.95. */
#endif /* __USE_ISOC9X. */