本文发表在 rolia.net 枫下论坛Below is the relative content from /usr/include/arpa/nameser.h
#ifndef BYTE_ORDER
#if (BSD >= 199103)
# include <machine/endian.h>
#else
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
defined(__alpha__) || defined(__alpha)
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || \
defined(apollo) || defined(__convex__) || defined(__hppa) || \
defined(__hp9000) || defined(__hp9000s300) || defined(__hp9000s700) || \
defined (BIT_ZERO_ON_LEFT)
#define BYTE_ORDER BIG_ENDIAN
#endif
#endif /* BSD */
#endif /* BYTE_ORDER */
What's more, Endian is mentioned in below header files too:
/usr/include/sys/fs/vx_port.h
/usr/include/sys/pci.h
/usr/include/sys/spinlock.h
/usr/include/arpa/nameser.h
/usr/include/machine/param.h
Thank you guys....更多精彩文章及讨论,请光临枫下论坛 rolia.net
#ifndef BYTE_ORDER
#if (BSD >= 199103)
# include <machine/endian.h>
#else
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
defined(__alpha__) || defined(__alpha)
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || \
defined(apollo) || defined(__convex__) || defined(__hppa) || \
defined(__hp9000) || defined(__hp9000s300) || defined(__hp9000s700) || \
defined (BIT_ZERO_ON_LEFT)
#define BYTE_ORDER BIG_ENDIAN
#endif
#endif /* BSD */
#endif /* BYTE_ORDER */
What's more, Endian is mentioned in below header files too:
/usr/include/sys/fs/vx_port.h
/usr/include/sys/pci.h
/usr/include/sys/spinlock.h
/usr/include/arpa/nameser.h
/usr/include/machine/param.h
Thank you guys....更多精彩文章及讨论,请光临枫下论坛 rolia.net