diff options
author | Michael Meissner <gnu@the-meissners.org> | 2000-07-28 16:27:55 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 2000-07-28 16:27:55 +0000 |
commit | 7c110b172c257ab253d317d5ad58f4c557d9cfd9 (patch) | |
tree | d9b284c4cbeb1777d25e52a1e791e7144f87c016 /newlib/libc/include/math.h | |
parent | b7d9755e164749c429a5e00608aeb9930e1727ce (diff) | |
download | cygnal-7c110b172c257ab253d317d5ad58f4c557d9cfd9.tar.gz cygnal-7c110b172c257ab253d317d5ad58f4c557d9cfd9.tar.bz2 cygnal-7c110b172c257ab253d317d5ad58f4c557d9cfd9.zip |
Declare __infinity as an array to work around problems with small data support
Diffstat (limited to 'newlib/libc/include/math.h')
-rw-r--r-- | newlib/libc/include/math.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index cd03945c9..6a6440dc7 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -21,13 +21,23 @@ union __dmath 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) -extern const union __dmath __infinity; +#define __INFINITY_DECL__ #else -extern __declspec(dllimport) const union __dmath __infinity; +#define __INFINITY_DECL__ __declspec(dllimport) +#endif #endif -#define HUGE_VAL (__infinity.d) +extern __INFINITY_DECL__ const union __dmath __infinity[]; + +#define HUGE_VAL (__infinity[0].d) #endif /* ! defined (HUGE_VAL) */ |