diff options
author | mike <mike@FreeBSD.org> | 2002-04-10 14:39:14 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-04-10 14:39:14 +0000 |
commit | 7fb662578d64e154082914adb1d39ba8abfb3f8a (patch) | |
tree | ed4fc08fc630dc7ff1b6602a205ea15dbbf66da1 /sys | |
parent | 509170f4fdd4981277ef3ceeb7b316809aef7646 (diff) | |
download | FreeBSD-src-7fb662578d64e154082914adb1d39ba8abfb3f8a.zip FreeBSD-src-7fb662578d64e154082914adb1d39ba8abfb3f8a.tar.gz |
Add manifest constants: _LITTLE_ENDIAN, _BIG_ENDIAN, _PDP_ENDIAN, and
_BYTE_ORDER. These are far more useful than their non-underscored
equivalents as these can be used in restricted namespace environments.
Mark the non-underscored variants as deprecated.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/include/endian.h | 21 | ||||
-rw-r--r-- | sys/i386/include/endian.h | 21 | ||||
-rw-r--r-- | sys/ia64/include/endian.h | 21 | ||||
-rw-r--r-- | sys/powerpc/include/endian.h | 21 | ||||
-rw-r--r-- | sys/sparc64/include/endian.h | 21 |
5 files changed, 75 insertions, 30 deletions
diff --git a/sys/alpha/include/endian.h b/sys/alpha/include/endian.h index 6781ceda..64d433b 100644 --- a/sys/alpha/include/endian.h +++ b/sys/alpha/include/endian.h @@ -46,17 +46,26 @@ #define _QUAD_HIGHWORD 1 #define _QUAD_LOWWORD 0 -#ifndef _POSIX_SOURCE /* * Definitions for byte order, according to byte significance from low * address to high. */ -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define BYTE_ORDER LITTLE_ENDIAN -#endif /* !_POSIX_SOURCE */ +#define _BYTE_ORDER _LITTLE_ENDIAN + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif #ifdef __GNUC__ diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h index 115511f..84e7fe6 100644 --- a/sys/i386/include/endian.h +++ b/sys/i386/include/endian.h @@ -46,17 +46,26 @@ #define _QUAD_HIGHWORD 1 #define _QUAD_LOWWORD 0 -#ifndef _POSIX_SOURCE /* * Definitions for byte order, according to byte significance from low * address to high. */ -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define BYTE_ORDER LITTLE_ENDIAN -#endif /* ! _POSIX_SOURCE */ +#define _BYTE_ORDER _LITTLE_ENDIAN + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif #ifdef __GNUC__ diff --git a/sys/ia64/include/endian.h b/sys/ia64/include/endian.h index 826fa54..5ae1ac5 100644 --- a/sys/ia64/include/endian.h +++ b/sys/ia64/include/endian.h @@ -47,17 +47,26 @@ #define _QUAD_HIGHWORD 1 #define _QUAD_LOWWORD 0 -#ifndef _POSIX_SOURCE /* * Definitions for byte order, according to byte significance from low * address to high. */ -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define BYTE_ORDER LITTLE_ENDIAN -#endif /* !_POSIX_SOURCE */ +#define _BYTE_ORDER _LITTLE_ENDIAN + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif #ifdef __GNUC__ diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index 4bccc4e..5cab6da 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -50,13 +50,22 @@ * Definitions for byte order, according to byte significance from low * address to high. */ -#ifndef _POSIX_SOURCE -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define BYTE_ORDER BIG_ENDIAN -#endif /* !_POSIX_SOURCE */ +#define _BYTE_ORDER _BIG_ENDIAN + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif #ifdef __GNUC__ diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h index b3f27d8..c8eac24 100644 --- a/sys/sparc64/include/endian.h +++ b/sys/sparc64/include/endian.h @@ -45,17 +45,26 @@ #define _QUAD_HIGHWORD 0 #define _QUAD_LOWWORD 1 -#ifndef _POSIX_SOURCE /* * Definitions for byte order, according to byte significance from low * address to high. */ -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ +#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ -#define BYTE_ORDER BIG_ENDIAN -#endif /* !_POSIX_SOURCE */ +#define _BYTE_ORDER _BIG_ENDIAN + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif #ifdef __GNUC__ |