Re-apply the previously backed-out commit that fixes the problem where

HUGE_VAL is not properly aligned on some architectures. The previous
fix now works because the two versions of 'math.h' (include/math.h
and lib/msun/src/math.h) have since been merged into one.

PR:	bin/43544
This commit is contained in:
Archie Cobbs 2002-10-31 23:05:20 +00:00
parent 06527f6dc3
commit 83999f5a32
6 changed files with 10 additions and 7 deletions

View File

@ -33,4 +33,4 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on an Alpha (IEEE double format) */
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };

View File

@ -8,4 +8,4 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on a 387 */
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };

View File

@ -8,4 +8,4 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on a 387 */
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };

View File

@ -33,4 +33,4 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on an ia64 (IEEE double format) */
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };

View File

@ -11,4 +11,4 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on a sparc */
char __infinity[] = { 0x7f, (char)0xf0, 0, 0, 0, 0, 0, 0 };
const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };

View File

@ -20,8 +20,11 @@
/*
* ANSI/POSIX
*/
extern char __infinity[];
#define HUGE_VAL (*(double *) __infinity)
extern const union __infinity_un {
unsigned char __uc[8];
double __ud;
} __infinity;
#define HUGE_VAL (__infinity.__ud)
/*
* XOPEN/SVID