2005-10-20 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h (HUGE_VAL, HUGE_VALF, HUGE_VALL): When gcc is 3.3 or greater, use special gcc builtins.
This commit is contained in:
parent
34da20b26f
commit
09968b6d27
|
@ -1,3 +1,8 @@
|
||||||
|
2005-10-20 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
|
* libc/include/math.h (HUGE_VAL, HUGE_VALF, HUGE_VALL): When
|
||||||
|
gcc is 3.3 or greater, use special gcc builtins.
|
||||||
|
|
||||||
2005-10-20 Corinna Vinschen <corinna@vinschen.de>
|
2005-10-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* libc/include/sys/time.h: Declare futimes and lutimes for Cygwin.
|
* libc/include/sys/time.h: Declare futimes and lutimes for Cygwin.
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
|
|
||||||
_BEGIN_STD_C
|
_BEGIN_STD_C
|
||||||
|
|
||||||
#ifndef HUGE_VAL
|
union __dmath
|
||||||
|
{
|
||||||
/* Define HUGE_VAL as infinity, unless HUGE_VAL is already defined
|
__ULong i[2];
|
||||||
(which might have been done by something like math-68881.h). */
|
double d;
|
||||||
|
};
|
||||||
|
|
||||||
union __fmath
|
union __fmath
|
||||||
{
|
{
|
||||||
|
@ -20,30 +21,53 @@ union __fmath
|
||||||
float f;
|
float f;
|
||||||
};
|
};
|
||||||
|
|
||||||
union __dmath
|
|
||||||
{
|
|
||||||
__ULong i[2];
|
|
||||||
double d;
|
|
||||||
};
|
|
||||||
|
|
||||||
union __ldmath
|
union __ldmath
|
||||||
{
|
{
|
||||||
__ULong i[4];
|
__ULong i[4];
|
||||||
_LONG_DOUBLE ld;
|
_LONG_DOUBLE ld;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Declare this as an array without bounds so that no matter what small data
|
#if defined(__GNUC__) && \
|
||||||
support a port and/or library has, this reference will be via the general
|
( (__GNUC__ >= 4) || \
|
||||||
method for accessing globals. */
|
( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
|
||||||
|
|
||||||
|
/* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */
|
||||||
|
|
||||||
|
#ifndef HUGE_VAL
|
||||||
|
#define HUGE_VAL (__builtin_huge_val())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HUGE_VALF
|
||||||
|
#define HUGE_VALF (__builtin_huge_valf())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HUGE_VALL
|
||||||
|
#define HUGE_VALL (__builtin_huge_vall())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /* !gcc >= 3.3 */
|
||||||
|
|
||||||
|
/* No builtins. Use floating-point unions instead. Declare as an array
|
||||||
|
without bounds so no matter what small data support a port and/or
|
||||||
|
library has, the reference will be via the general method for accessing
|
||||||
|
globals. */
|
||||||
|
|
||||||
|
#ifndef HUGE_VAL
|
||||||
extern __IMPORT const union __dmath __infinity[];
|
extern __IMPORT const union __dmath __infinity[];
|
||||||
extern __IMPORT const union __fmath __infinityf[];
|
|
||||||
extern __IMPORT const union __ldmath __infinityld[];
|
|
||||||
|
|
||||||
#define HUGE_VAL (__infinity[0].d)
|
#define HUGE_VAL (__infinity[0].d)
|
||||||
#define HUGE_VALF (__infinityf[0].f)
|
#endif
|
||||||
#define HUGE_VALL (__infinityld[0].ld)
|
|
||||||
|
|
||||||
#endif /* ! defined (HUGE_VAL) */
|
#ifndef HUGE_VALF
|
||||||
|
extern __IMPORT const union __fmath __infinityf[];
|
||||||
|
#define HUGE_VALF (__infinityf[0].f)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HUGE_VALL
|
||||||
|
extern __IMPORT const union __ldmath __infinityld[];
|
||||||
|
#define HUGE_VALL (__infinityld[0].ld)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !gcc >= 3.3 */
|
||||||
|
|
||||||
/* Reentrant ANSI C functions. */
|
/* Reentrant ANSI C functions. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue