mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
2002-07-02 Chris Demetriou <cgd@broadcom.com>
* libc/include/sys/config.h (__IEEE_LITTLE_ENDIAN) (__IEEE_BIG_ENDIAN): Define appropriately for MIPS. Check that one of them is defined and error out if not. Add any platforms defined in <machine/ieeefp.h> that are missing. * libc/search/hash.h (DB_BYTE_ORDER, DB_BIG_ENDIAN) (DB_LITTLE_ENDIAN): New defines. * libc/search/hash.c: Replace all incorrect checks for _IEEE_LITTLE_ENDIAN with tests of BYTE_ORDER, and all uses of BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN with DB_* versions. * libc/search/hash_page.c: Likewise.
This commit is contained in:
parent
d183515c9f
commit
cec4a9f8f0
@ -1,3 +1,16 @@
|
|||||||
|
2002-07-02 Chris Demetriou <cgd@broadcom.com>
|
||||||
|
|
||||||
|
* libc/include/sys/config.h (__IEEE_LITTLE_ENDIAN)
|
||||||
|
(__IEEE_BIG_ENDIAN): Define appropriately for MIPS.
|
||||||
|
Check that one of them is defined and error out if not.
|
||||||
|
Add any platforms defined in <machine/ieeefp.h> that are missing.
|
||||||
|
* libc/search/hash.h (DB_BYTE_ORDER, DB_BIG_ENDIAN)
|
||||||
|
(DB_LITTLE_ENDIAN): New defines.
|
||||||
|
* libc/search/hash.c: Replace all incorrect checks for
|
||||||
|
_IEEE_LITTLE_ENDIAN with tests of BYTE_ORDER, and all uses of
|
||||||
|
BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN with DB_* versions.
|
||||||
|
* libc/search/hash_page.c: Likewise.
|
||||||
|
|
||||||
2002-06-28 Thomas Fitzsimmons <fitzsim@redhat.com>
|
2002-06-28 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||||
|
|
||||||
* libm/mathfp/sf_pow.c (powf): Change k from int to float.
|
* libm/mathfp/sf_pow.c (powf): Change k from int to float.
|
||||||
|
@ -45,11 +45,23 @@
|
|||||||
#define __IEEE_BIG_ENDIAN
|
#define __IEEE_BIG_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __sh__
|
||||||
|
#ifdef __LITTLE_ENDIAN__
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#else
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
#if defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__)
|
||||||
|
#define _DOUBLE_IS_32BITS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ___AM29K__
|
#ifdef ___AM29K__
|
||||||
#define _FLOAT_RET double
|
#define _FLOAT_RET double
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
#ifndef __unix__
|
#ifndef __unix__
|
||||||
/* in other words, go32 */
|
/* in other words, go32 */
|
||||||
#define _FLOAT_RET double
|
#define _FLOAT_RET double
|
||||||
@ -82,6 +94,13 @@
|
|||||||
#define __IEEE_LITTLE_ENDIAN
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MIPSEL__
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
#ifdef __MIPSEB__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __MMIX__
|
#ifdef __MMIX__
|
||||||
#define __IEEE_BIG_ENDIAN
|
#define __IEEE_BIG_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
@ -97,19 +116,57 @@
|
|||||||
#define __IEEE_LITTLE_ENDIAN
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __v800
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __v850
|
#ifdef __v850
|
||||||
#define __IEEE_LITTLE_ENDIAN
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
|
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __ia64__
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __D30V__
|
#ifdef __D30V__
|
||||||
#define __IEEE_BIG_ENDIAN
|
#define __IEEE_BIG_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __m88k__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
|
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
|
||||||
#if defined(__PPC__) && defined(_CALL_SYSV)
|
#if defined(__PPC__)
|
||||||
|
#if defined(_CALL_SYSV)
|
||||||
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
|
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX)
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32)
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__arm__) || defined(__thumb__)
|
||||||
|
/* ARM always has big-endian words. Within those words the byte ordering
|
||||||
|
will be big or little endian depending upon the target. */
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#ifdef __ARMEL__
|
||||||
|
#define __IEEE_BYTES_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __hppa__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __sparc__
|
#ifdef __sparc__
|
||||||
#ifdef __LITTLE_ENDIAN_DATA__
|
#ifdef __LITTLE_ENDIAN_DATA__
|
||||||
@ -119,6 +176,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__or32__) || defined(__or1k__) || defined(__or16__)
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __xstormy16__
|
#ifdef __xstormy16__
|
||||||
#define __IEEE_LITTLE_ENDIAN
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
#define __SMALL_BITFIELDS
|
#define __SMALL_BITFIELDS
|
||||||
@ -164,6 +226,22 @@
|
|||||||
#define _POINTER_INT long
|
#define _POINTER_INT long
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __arc__
|
||||||
|
#ifdef __big_endian__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#define __IEEE_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __fr30__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __mcore__
|
||||||
|
#define __IEEE_BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __frv__
|
#ifdef __frv__
|
||||||
#define __IEEE_BIG_ENDIAN
|
#define __IEEE_BIG_ENDIAN
|
||||||
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
|
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
|
||||||
@ -202,4 +280,10 @@
|
|||||||
#define _READ_WRITE_RETURN_TYPE int
|
#define _READ_WRITE_RETURN_TYPE int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __IEEE_BIG_ENDIAN
|
||||||
|
#ifndef __IEEE_LITTLE_ENDIAN
|
||||||
|
#error Endianess not declared!!
|
||||||
|
#endif /* not __IEEE_LITTLE_ENDIAN */
|
||||||
|
#endif /* not __IEEE_BIG_ENDIAN */
|
||||||
|
|
||||||
#endif /* __SYS_CONFIG_H__ */
|
#endif /* __SYS_CONFIG_H__ */
|
||||||
|
@ -72,7 +72,7 @@ static int hash_sync(const DB *, __uint32_t);
|
|||||||
static int hdestroy(HTAB *);
|
static int hdestroy(HTAB *);
|
||||||
static HTAB *init_hash(HTAB *, const char *, HASHINFO *);
|
static HTAB *init_hash(HTAB *, const char *, HASHINFO *);
|
||||||
static int init_htab(HTAB *, int);
|
static int init_htab(HTAB *, int);
|
||||||
#ifdef _IEEE_LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
static void swap_header(HTAB *);
|
static void swap_header(HTAB *);
|
||||||
static void swap_header_copy(HASHHDR *, HASHHDR *);
|
static void swap_header_copy(HASHHDR *, HASHHDR *);
|
||||||
#endif
|
#endif
|
||||||
@ -156,7 +156,7 @@ __hash_open(file, flags, mode, info, dflags)
|
|||||||
hashp->hash = __default_hash;
|
hashp->hash = __default_hash;
|
||||||
|
|
||||||
hdrsize = read(hashp->fp, &hashp->hdr, sizeof(HASHHDR));
|
hdrsize = read(hashp->fp, &hashp->hdr, sizeof(HASHHDR));
|
||||||
#ifdef _IEEE_LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
swap_header(hashp);
|
swap_header(hashp);
|
||||||
#endif
|
#endif
|
||||||
if (hdrsize == -1)
|
if (hdrsize == -1)
|
||||||
@ -299,7 +299,7 @@ init_hash(hashp, file, info)
|
|||||||
|
|
||||||
nelem = 1;
|
nelem = 1;
|
||||||
hashp->NKEYS = 0;
|
hashp->NKEYS = 0;
|
||||||
hashp->LORDER = BYTE_ORDER;
|
hashp->LORDER = DB_BYTE_ORDER;
|
||||||
hashp->BSIZE = DEF_BUCKET_SIZE;
|
hashp->BSIZE = DEF_BUCKET_SIZE;
|
||||||
hashp->BSHIFT = DEF_BUCKET_SHIFT;
|
hashp->BSHIFT = DEF_BUCKET_SHIFT;
|
||||||
hashp->SGSIZE = DEF_SEGSIZE;
|
hashp->SGSIZE = DEF_SEGSIZE;
|
||||||
@ -335,8 +335,8 @@ init_hash(hashp, file, info)
|
|||||||
if (info->nelem)
|
if (info->nelem)
|
||||||
nelem = info->nelem;
|
nelem = info->nelem;
|
||||||
if (info->lorder) {
|
if (info->lorder) {
|
||||||
if (info->lorder != BIG_ENDIAN &&
|
if (info->lorder != DB_BIG_ENDIAN &&
|
||||||
info->lorder != LITTLE_ENDIAN) {
|
info->lorder != DB_LITTLE_ENDIAN) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -495,7 +495,7 @@ flush_meta(hashp)
|
|||||||
HTAB *hashp;
|
HTAB *hashp;
|
||||||
{
|
{
|
||||||
HASHHDR *whdrp;
|
HASHHDR *whdrp;
|
||||||
#ifdef _IEEE_LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
HASHHDR whdr;
|
HASHHDR whdr;
|
||||||
#endif
|
#endif
|
||||||
int fp, i, wsize;
|
int fp, i, wsize;
|
||||||
@ -508,7 +508,7 @@ flush_meta(hashp)
|
|||||||
|
|
||||||
fp = hashp->fp;
|
fp = hashp->fp;
|
||||||
whdrp = &hashp->hdr;
|
whdrp = &hashp->hdr;
|
||||||
#ifdef _IEEE_LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
whdrp = &whdr;
|
whdrp = &whdr;
|
||||||
swap_header_copy(&hashp->hdr, whdrp);
|
swap_header_copy(&hashp->hdr, whdrp);
|
||||||
#endif
|
#endif
|
||||||
@ -941,7 +941,7 @@ alloc_segs(hashp, nsegs)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _IEEE_LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
/*
|
/*
|
||||||
* Hashp->hdr needs to be byteswapped.
|
* Hashp->hdr needs to be byteswapped.
|
||||||
*/
|
*/
|
||||||
|
@ -39,18 +39,18 @@
|
|||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
|
/* Check that newlib understands the byte order of its target system. */
|
||||||
#ifndef BYTE_ORDER
|
#ifndef BYTE_ORDER
|
||||||
#ifndef LITTLE_ENDIAN
|
#error BYTE_ORDER not defined by sys/param.h
|
||||||
#define LITTLE_ENDIAN 1234
|
|
||||||
#endif
|
#endif
|
||||||
#ifndef BIG_ENDIAN
|
|
||||||
#define BIG_ENDIAN 4321
|
/* Define DB endianness constants based on target endianness. */
|
||||||
#endif
|
#define DB_LITTLE_ENDIAN 1234
|
||||||
#ifdef __IEEE_LITTLE_ENDIAN
|
#define DB_BIG_ENDIAN 4321
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
|
#define DB_BYTE_ORDER DB_LITTLE_ENDIAN
|
||||||
#else
|
#else
|
||||||
#define BYTE_ORDER BIG_ENDIAN
|
#define DB_BYTE_ORDER DB_BIG_ENDIAN
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Operations */
|
/* Operations */
|
||||||
|
@ -552,7 +552,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap)
|
|||||||
if (!is_bitmap && !bp[0]) {
|
if (!is_bitmap && !bp[0]) {
|
||||||
PAGE_INIT(p);
|
PAGE_INIT(p);
|
||||||
} else
|
} else
|
||||||
if (hashp->LORDER != BYTE_ORDER) {
|
if (hashp->LORDER != DB_BYTE_ORDER) {
|
||||||
int i, max;
|
int i, max;
|
||||||
|
|
||||||
if (is_bitmap) {
|
if (is_bitmap) {
|
||||||
@ -591,7 +591,7 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap)
|
|||||||
return (-1);
|
return (-1);
|
||||||
fd = hashp->fp;
|
fd = hashp->fp;
|
||||||
|
|
||||||
if (hashp->LORDER != BYTE_ORDER) {
|
if (hashp->LORDER != DB_BYTE_ORDER) {
|
||||||
int i;
|
int i;
|
||||||
int max;
|
int max;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user