diff options
22 files changed, 567 insertions, 293 deletions
diff --git a/include/math.h b/include/math.h index 8c11b5a76..c50b2e7b0 100644 --- a/include/math.h +++ b/include/math.h @@ -1,5 +1,6 @@ /* Declarations for math functions. - Copyright (C) 1991,92,93,95,96,97,98,99,2001 Free Software Foundation, Inc. + Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006 + 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 @@ -31,15 +32,20 @@ __BEGIN_DECLS /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #include <bits/huge_val.h> +#ifdef __USE_ISOC99 +# include <bits/huge_valf.h> +# include <bits/huge_vall.h> + +/* Get machine-dependent INFINITY value. */ +# include <bits/inf.h> -#ifdef __USE_ISOC99 /* Get machine-dependent NAN value (returned for some domain errors). */ # include <bits/nan.h> -#endif +#endif /* __USE_ISOC99 */ + /* Get general and ISO C99 specific information. */ #include <bits/mathdef.h> - /* The file <bits/mathcalls.h> contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', @@ -60,8 +66,12 @@ __BEGIN_DECLS #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #include <bits/mathcalls.h> #undef _Mdouble_ +#undef _Mdouble_BEGIN_NAMESPACE +#undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #if defined __USE_MISC || defined __USE_ISOC99 @@ -79,14 +89,44 @@ __BEGIN_DECLS # else # define __MATH_PRECNAME(name,r) name/**/f/**/r # endif +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include <bits/mathcalls.h> # undef _Mdouble_ +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME -# if (__STDC__ - 0 || __GNUC__ - 0) && !defined __NO_LONG_DOUBLE_MATH +# if (__STDC__ - 0 || __GNUC__ - 0) \ + && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT) +# ifdef __LDBL_COMPAT + +# ifdef __USE_ISOC99 +extern float __nldbl_nexttowardf (float __x, long double __y) + __THROW __attribute__ ((__const__)); +# ifdef __REDIRECT_NTH +extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), + __nldbl_nexttowardf) + __attribute__ ((__const__)); +extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), + nextafter) __attribute__ ((__const__)); +extern long double __REDIRECT_NTH (nexttowardl, + (long double __x, long double __y), + nextafter) __attribute__ ((__const__)); +# endif +# endif + /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ +# undef __MATHDECL_1 +# define __MATHDECL_2(type, function,suffix, args, alias) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ + args, alias) +# define __MATHDECL_1(type, function,suffix, args) \ + __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) +# endif + # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif @@ -96,8 +136,12 @@ __BEGIN_DECLS # else # define __MATH_PRECNAME(name,r) name/**/l/**/r # endif +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include <bits/mathcalls.h> # undef _Mdouble_ +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* __STDC__ || __GNUC__ */ @@ -345,18 +389,28 @@ extern int matherr (struct exception *__exc); # define __NO_MATH_INLINES 1 #endif +#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) +/* ISO C99 defines some macros to compare number while taking care for + unordered numbers. Many FPUs provide special instructions to support + these operations. Generic support in GCC for these as builtins went + in before 3.0.0, but not all cpus added their patterns. We define + versions that use the builtins here, and <bits/mathinline.h> will + undef/redefine as appropriate for the specific GCC version in use. */ +# define isgreater(x, y) __builtin_isgreater(x, y) +# define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +# define isless(x, y) __builtin_isless(x, y) +# define islessequal(x, y) __builtin_islessequal(x, y) +# define islessgreater(x, y) __builtin_islessgreater(x, y) +# define isunordered(u, v) __builtin_isunordered(u, v) +#endif + /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES # include <bits/mathinline.h> #endif - #ifdef __USE_ISOC99 -/* ISO C99 defines some macros to compare number while taking care for - unordered numbers. Many FPUs provide special instructions to support - these operations and these tests are defined in <bits/mathinline.h>, - we define the generic macros at this late point and only if they are - not defined yet. */ +/* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater diff --git a/libc/sysdeps/linux/common/bits/confname.h b/libc/sysdeps/linux/common/bits/confname.h index a66f85aac..ab7fdee9d 100644 --- a/libc/sysdeps/linux/common/bits/confname.h +++ b/libc/sysdeps/linux/common/bits/confname.h @@ -63,8 +63,10 @@ enum #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN - _PC_SYMLINK_MAX + _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX + _PC_2_SYMLINKS +#define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ @@ -459,8 +461,45 @@ enum #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT - _SC_TRACE_LOG + _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG + + _SC_LEVEL1_ICACHE_SIZE, +#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE + _SC_LEVEL1_ICACHE_ASSOC, +#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC + _SC_LEVEL1_ICACHE_LINESIZE, +#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE + _SC_LEVEL1_DCACHE_SIZE, +#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE + _SC_LEVEL1_DCACHE_ASSOC, +#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC + _SC_LEVEL1_DCACHE_LINESIZE, +#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE + _SC_LEVEL2_CACHE_SIZE, +#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE + _SC_LEVEL2_CACHE_ASSOC, +#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC + _SC_LEVEL2_CACHE_LINESIZE, +#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE + _SC_LEVEL3_CACHE_SIZE, +#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE + _SC_LEVEL3_CACHE_ASSOC, +#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC + _SC_LEVEL3_CACHE_LINESIZE, +#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE + _SC_LEVEL4_CACHE_SIZE, +#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE + _SC_LEVEL4_CACHE_ASSOC, +#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC + _SC_LEVEL4_CACHE_LINESIZE, +#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE + /* Leave room here, maybe we need a few more cache levels some day. */ + + _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, +#define _SC_IPV6 _SC_IPV6 + _SC_RAW_SOCKETS +#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS }; #if (defined __USE_POSIX2 || defined __USE_UNIX98 \ diff --git a/libc/sysdeps/linux/common/bits/dlfcn.h b/libc/sysdeps/linux/common/bits/dlfcn.h index 75122a98a..f68849843 100644 --- a/libc/sysdeps/linux/common/bits/dlfcn.h +++ b/libc/sysdeps/linux/common/bits/dlfcn.h @@ -1,5 +1,5 @@ /* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2004 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,6 +26,7 @@ #define RTLD_NOW 0x00002 /* Immediate function call binding. */ #define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */ +#define RTLD_DEEPBIND 0x00008 /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made @@ -40,3 +41,25 @@ /* Do not delete object when closed. */ #define RTLD_NODELETE 0x01000 +#if 0 /*def __USE_GNU*/ +/* To support profiling of shared objects it is a good idea to call + the function found using `dlsym' using the following macro since + these calls do not use the PLT. But this would mean the dynamic + loader has no chance to find out when the function is called. The + macro applies the necessary magic so that profiling is possible. + Rewrite + foo = (*fctp) (arg1, arg2); + into + foo = DL_CALL_FCT (fctp, (arg1, arg2)); +*/ +# define DL_CALL_FCT(fctp, args) \ + (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) + +__BEGIN_DECLS + +/* This function calls the profiling functions. */ +extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; + +__END_DECLS + +#endif diff --git a/libc/sysdeps/linux/common/bits/huge_val.h b/libc/sysdeps/linux/common/bits/huge_val.h index b33974364..11ca11f18 100644 --- a/libc/sysdeps/linux/common/bits/huge_val.h +++ b/libc/sysdeps/linux/common/bits/huge_val.h @@ -1,6 +1,7 @@ -/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). +/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). Used by <stdlib.h> and <math.h> functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 + 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 @@ -22,25 +23,19 @@ # error "Never use <bits/huge_val.h> directly; include <math.h> instead." #endif -#include <features.h> - /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ -#ifdef __GNUC__ - -# if __GNUC_PREREQ(2,96) - -# define HUGE_VAL (__extension__ 0x1.0p2047) +#if __GNUC_PREREQ(3,3) +# define HUGE_VAL (__builtin_huge_val()) +#elif __GNUC_PREREQ(2,96) +# define HUGE_VAL (__extension__ 0x1.0p2047) +#elif defined __GNUC__ -# else - -# define HUGE_VAL \ +# define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ { __l: 0x7ff0000000000000ULL }).__d) -# endif - #else /* not GCC */ # include <endian.h> @@ -58,46 +53,3 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; # define HUGE_VAL (__huge_val.__d) #endif /* GCC. */ - - -/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ - -#ifdef __USE_ISOC99 - -# ifdef __GNUC__ - -# if __GNUC_PREREQ(2,96) - -# define HUGE_VALF (__extension__ 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; - -# if __BYTE_ORDER == __BIG_ENDIAN -# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } -# endif -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } -# endif - -static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -# define HUGE_VALF (__huge_valf.__f) - -# endif /* GCC. */ - - -/* Generally there is no separate `long double' format and it is the - same as `double'. */ -# define HUGE_VALL HUGE_VAL - -#endif /* __USE_ISOC99. */ diff --git a/libc/sysdeps/linux/common/bits/huge_valf.h b/libc/sysdeps/linux/common/bits/huge_valf.h new file mode 100644 index 000000000..1785342cd --- /dev/null +++ b/libc/sysdeps/linux/common/bits/huge_valf.h @@ -0,0 +1,53 @@ +/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity). + Used by <stdlib.h> and <math.h> functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 + 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use <bits/huge_valf.h> directly; include <math.h> instead." +#endif + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#if __GNUC_PREREQ(3,3) +# define HUGE_VALF (__builtin_huge_valf()) +#elif __GNUC_PREREQ(2,96) +# define HUGE_VALF (__extension__ 0x1.0p255f) +#elif defined __GNUC__ + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7f800000UL }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } +# endif + +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +# define HUGE_VALF (__huge_valf.__f) + +#endif /* GCC. */ diff --git a/libc/sysdeps/linux/common/bits/huge_vall.h b/libc/sysdeps/linux/common/bits/huge_vall.h new file mode 100644 index 000000000..d5e8e2237 --- /dev/null +++ b/libc/sysdeps/linux/common/bits/huge_vall.h @@ -0,0 +1,29 @@ +/* Default `HUGE_VALL' constant. + Used by <stdlib.h> and <math.h> functions for overflow. + Copyright (C) 1992, 1996, 1997, 2004 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use <bits/huge_vall.h> directly; include <math.h> instead." +#endif + +#if __GNUC_PREREQ(3,3) +# define HUGE_VALL (__builtin_huge_vall()) +#else +# define HUGE_VALL ((long double) HUGE_VAL) +#endif diff --git a/libc/sysdeps/linux/common/bits/inf.h b/libc/sysdeps/linux/common/bits/inf.h new file mode 100644 index 000000000..1619f756e --- /dev/null +++ b/libc/sysdeps/linux/common/bits/inf.h @@ -0,0 +1,30 @@ +/* `INFINITY' constant for IEEE 754 machines. + Copyright (C) 2004 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use <bits/inf.h> directly; include <math.h> instead." +#endif + +/* IEEE positive infinity. */ + +#if __GNUC_PREREQ(3,3) +# define INFINITY (__builtin_inff()) +#else +# define INFINITY HUGE_VALF +#endif diff --git a/libc/sysdeps/linux/common/bits/local_lim.h b/libc/sysdeps/linux/common/bits/local_lim.h index d4671e4a8..b639ba44a 100644 --- a/libc/sysdeps/linux/common/bits/local_lim.h +++ b/libc/sysdeps/linux/common/bits/local_lim.h @@ -1,11 +1,11 @@ /* Minimum guaranteed maximum values for system limits. Linux version. - Copyright (C) 1993-1998, 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1993-1998,2000,2002,2003,2004 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,9 +13,9 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A @@ -63,16 +63,19 @@ /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 -/* This is the value this implementation supports. */ -#define PTHREAD_THREADS_MAX 1024 - -/* Minimum size for a thread. We are free to choose a reasonable value. */ -#define PTHREAD_STACK_MIN 16384 +/* We have no predefined limit on the number of threads. */ +#undef PTHREAD_THREADS_MAX /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ #define AIO_PRIO_DELTA_MAX 20 +/* Minimum size for a thread. We are free to choose a reasonable value. */ +#define PTHREAD_STACK_MIN 16384 + +/* Maximum number of timer expiration overruns. */ +#define DELAYTIMER_MAX 2147483647 + /* Maximum tty name length. */ #define TTY_NAME_MAX 32 @@ -84,6 +87,3 @@ /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 - -/* Maximum number of POSIX timers available. */ -#define TIMER_MAX 256 diff --git a/libc/sysdeps/linux/common/bits/locale.h b/libc/sysdeps/linux/common/bits/locale.h index 50064b53e..5d5178361 100644 --- a/libc/sysdeps/linux/common/bits/locale.h +++ b/libc/sysdeps/linux/common/bits/locale.h @@ -33,12 +33,14 @@ enum __LC_MONETARY = 4, __LC_MESSAGES = 5, __LC_ALL = 6, +#if 0 __LC_PAPER = 7, __LC_NAME = 8, __LC_ADDRESS = 9, __LC_TELEPHONE = 10, __LC_MEASUREMENT = 11, __LC_IDENTIFICATION = 12 +#endif }; #endif /* bits/locale.h */ diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h index c1181f737..c02007284 100644 --- a/libc/sysdeps/linux/common/bits/mathcalls.h +++ b/libc/sysdeps/linux/common/bits/mathcalls.h @@ -1,5 +1,5 @@ /* Prototype declarations for math functions; helper file for <math.h>. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2002, 2003, 2006 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 @@ -44,12 +44,13 @@ NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H - #error "Never include <bits/mathcalls.h> directly; include <math.h> instead." +# error "Never include <bits/mathcalls.h> directly; include <math.h> instead." #endif /* Trigonometric functions. */ +_Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ @@ -66,12 +67,6 @@ __MATHCALL (sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL (tan,, (_Mdouble_ __x)); -#ifdef __USE_GNU -/* Cosine and sine of X. */ -__MATHDECL (void,sincos,, - (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); -#endif - /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ @@ -80,28 +75,31 @@ __MATHCALL (cosh,, (_Mdouble_ __x)); __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); +_Mdouble_END_NAMESPACE + +#if 0 /*def __USE_GNU*/ +/* Cosine and sine of X. */ +__MATHDECL (void,sincos,, + (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); +#endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL (atanh,, (_Mdouble_ __x)); +__END_NAMESPACE_C99 #endif /* Exponential and logarithmic functions. */ +_Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL (exp,, (_Mdouble_ __x)); -#ifdef __USE_GNU -/* A function missing in all standards: compute exponent to base ten. */ -__MATHCALL (exp10,, (_Mdouble_ __x)); -/* Another name occasionally used. */ -__MATHCALL (pow10,, (_Mdouble_ __x)); -#endif - /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); @@ -116,8 +114,17 @@ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)); +_Mdouble_END_NAMESPACE + +#if 0 /*def __USE_GNU*/ +/* A function missing in all standards: compute exponent to base ten. */ +__MATHCALL (exp10,, (_Mdouble_ __x)); +/* Another name occasionally used. */ +__MATHCALL (pow10,, (_Mdouble_ __x)); +#endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); @@ -126,46 +133,56 @@ __MATHCALL (log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL (logb,, (_Mdouble_ __x)); +__END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_ __x)); +__END_NAMESPACE_C99 #endif /* Power functions. */ +_Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); +_Mdouble_END_NAMESPACE #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); +__END_NAMESPACE_C99 #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); +__END_NAMESPACE_C99 #endif /* Nearest integer, absolute value, and remainder functions. */ +_Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ -__MATHCALL (ceil,, (_Mdouble_ __x)); +__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ -__MATHCALL (floor,, (_Mdouble_ __x)); +__MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -177,6 +194,7 @@ __MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +_Mdouble_END_NAMESPACE #ifdef __USE_MISC /* Return 0 if VALUE is finite or NaN, +1 if it @@ -195,13 +213,17 @@ __MATHCALL (significand,, (_Mdouble_ __x)); #endif /* Use misc. */ #if defined __USE_MISC || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); +__END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return representation of NaN for double type. */ __MATHCALLX (nan,, (__const char *__tagb), (__const__)); +__END_NAMESPACE_C99 #endif @@ -223,14 +245,19 @@ __MATHCALL (yn,, (int, _Mdouble_)); #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); +__END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 +__BEGIN_NAMESPACE_C99 +/* True gamma function. */ __MATHCALL (tgamma,, (_Mdouble_)); +__END_NAMESPACE_C99 #endif #if defined __USE_MISC || defined __USE_XOPEN @@ -247,24 +274,20 @@ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 +__BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); -# ifdef __USE_ISOC99 +# if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); -# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED -/* Return X times (2 to the Nth power). */ -__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); -# endif - # if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); @@ -284,7 +307,7 @@ __MATHCALL (nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ -__MATHCALL (round,, (_Mdouble_ __x)); +__MATHCALLX (round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ @@ -331,3 +354,12 @@ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) /* Multiply-add function computed as a ternary operation. */ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ + +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 +__END_NAMESPACE_C99 +#endif + +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED +/* Return X times (2 to the Nth power). */ +__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); +#endif diff --git a/libc/sysdeps/linux/common/bits/mathdef.h b/libc/sysdeps/linux/common/bits/mathdef.h index d08dc3820..00c67241a 100644 --- a/libc/sysdeps/linux/common/bits/mathdef.h +++ b/libc/sysdeps/linux/common/bits/mathdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000, 2004 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,10 +30,6 @@ typedef double float_t; /* `float' expressions are evaluated as typedef double double_t; /* `double' expressions are evaluated as `double'. */ -/* Define `INFINITY' as value of type `float'. */ -# define INFINITY HUGE_VALF - - /* The values returned by `ilogb' for 0 and NaN respectively. */ # define FP_ILOGB0 (-2147483647) # define FP_ILOGBNAN 2147483647 diff --git a/libc/sysdeps/linux/common/bits/posix1_lim.h b/libc/sysdeps/linux/common/bits/posix1_lim.h index 9379d46f4..3c86dcec1 100644 --- a/libc/sysdeps/linux/common/bits/posix1_lim.h +++ b/libc/sysdeps/linux/common/bits/posix1_lim.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1993,96,98,2000,01,02,2003 Free Software Foundation, Inc. +/* Copyright (C) 1991-1993,96,98,2000-2003,2004 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 @@ -38,14 +38,25 @@ #define _POSIX_ARG_MAX 4096 /* Maximum simultaneous processes per real user ID. */ -#define _POSIX_CH |