mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-18 23:12:15 +08:00
Declare __infinity as an array to work around problems with small data support
This commit is contained in:
parent
b7d9755e16
commit
7c110b172c
@ -1,3 +1,11 @@
|
|||||||
|
2000-07-28 Michael Meissner <meissner@redhat.com>
|
||||||
|
|
||||||
|
* libc/include/math.h (__infinity): Declare as an array without
|
||||||
|
bounds to get around small data support. Rewrite Cygwin support
|
||||||
|
to be more general.
|
||||||
|
* libm/math/s_infconst.c (__infinity): Ditto.
|
||||||
|
* libm/mathfp/s_infconst.c (__infinity): Ditto.
|
||||||
|
|
||||||
Thu Jul 27 10:46:01 2000 Christopher Faylor <cgf@cygnus.com>
|
Thu Jul 27 10:46:01 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* libc/include/math.h: Use appropriate dll import linkage for
|
* libc/include/math.h: Use appropriate dll import linkage for
|
||||||
|
@ -21,13 +21,23 @@ union __dmath
|
|||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Declare this as an array without bounds so that no matter what small data
|
||||||
|
support a port and/or library has, this reference will be via the general
|
||||||
|
method for accessing globals.
|
||||||
|
|
||||||
|
Also under Cygwin, the library exports a pointer to the real value, so we
|
||||||
|
need to properly dereference it. */
|
||||||
|
#ifndef __INFINITY_DECL__
|
||||||
#if !defined(__CYGWIN__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
|
#if !defined(__CYGWIN__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
|
||||||
extern const union __dmath __infinity;
|
#define __INFINITY_DECL__
|
||||||
#else
|
#else
|
||||||
extern __declspec(dllimport) const union __dmath __infinity;
|
#define __INFINITY_DECL__ __declspec(dllimport)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HUGE_VAL (__infinity.d)
|
extern __INFINITY_DECL__ const union __dmath __infinity[];
|
||||||
|
|
||||||
|
#define HUGE_VAL (__infinity[0].d)
|
||||||
|
|
||||||
#endif /* ! defined (HUGE_VAL) */
|
#endif /* ! defined (HUGE_VAL) */
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
#ifndef _DOUBLE_IS_32BITS
|
#ifndef _DOUBLE_IS_32BITS
|
||||||
#ifdef __IEEE_BIG_ENDIAN
|
#ifdef __IEEE_BIG_ENDIAN
|
||||||
const union __dmath __infinity = { 0x7ff00000, 0 };
|
const union __dmath __infinity[1] = {{ 0x7ff00000, 0 }};
|
||||||
#else
|
#else
|
||||||
const union __dmath __infinity = { 0, 0x7ff00000 };
|
const union __dmath __infinity[1] = {{ 0, 0x7ff00000 }};
|
||||||
#endif
|
#endif
|
||||||
#else /* defined (_DOUBLE_IS_32BITS) */
|
#else /* defined (_DOUBLE_IS_32BITS) */
|
||||||
const union __dmath __infinity = { 0x7f800000, 0 };
|
const union __dmath __infinity[1] = {{ 0x7f800000, 0 }};
|
||||||
#endif /* defined (_DOUBLE_IS_32BITS) */
|
#endif /* defined (_DOUBLE_IS_32BITS) */
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
#ifndef _DOUBLE_IS_32BITS
|
#ifndef _DOUBLE_IS_32BITS
|
||||||
#ifdef __IEEE_BIG_ENDIAN
|
#ifdef __IEEE_BIG_ENDIAN
|
||||||
const union __dmath __infinity = { 0x7ff00000, 0 };
|
const union __dmath __infinity[1] = {{ 0x7ff00000, 0 }};
|
||||||
#else
|
#else
|
||||||
const union __dmath __infinity = { 0, 0x7ff00000 };
|
const union __dmath __infinity[1] = {{ 0, 0x7ff00000 }};
|
||||||
#endif
|
#endif
|
||||||
#else /* defined (_DOUBLE_IS_32BITS) */
|
#else /* defined (_DOUBLE_IS_32BITS) */
|
||||||
const union __dmath __infinity = { 0x7f800000, 0 };
|
const union __dmath __infinity[1] = {{ 0x7f800000, 0 }};
|
||||||
#endif /* defined (_DOUBLE_IS_32BITS) */
|
#endif /* defined (_DOUBLE_IS_32BITS) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user