Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Oct 2000 15:12:06 +0100
From:      Jeroen Ruigrok/Asmodai <asmodai@freebsd.org>
To:        arch@freebsd.org
Subject:   endian.h
Message-ID:  <20001029151205.C88101@daemon.ninth-circle.org>

next in thread | raw e-mail | index | archive | help
This is a bit of a hairy problem.

On FreeBSD we have <machine/endian.h> which defines things like
BYTE_ORDER and BIG_ENDIAN.

On OpenBSD we have <sys/endian.h> which is included from
<[archname]/endian.h> and defines BIG_ENDIAN and BYTE_ORDER.

On NetBSD we also have <sys/endian.h>, but we also have
<[archname]/endian.h> and <[archname]/endian_machdep.h> and there we
define _BYTE_ORDER and _BIG_ENDIAN.  However they also wrap BYTE_ORDER
and BIG_ENDIAN with _POSIX_SOURCE to provide backwards compatibility.

Linux has <endian.h> which defines __BYTE_ORDER and __BIG_ENDIAN.

I cannot find, this quickly, any references towards an endian.h or
BYTE_ORDER/BIG_ENDIAN standardness in C99, POSIX [latest drafts] or in
SUSv2.

Is someone able to shed some light on this?

I could envision that we might want a <endian.h> symlinked to
<machine/endian.h> and possibly our old and traditional BSD BYTE_ORDER
definitions wrapped as NetBSD did and then define some underscored names
for usage in POSIX environments.

-- 
Jeroen Ruigrok vd Werven/Asmodai    asmodai@[wxs.nl|bart.nl|freebsd.org]
Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
The BSD Programmer's Documentation Project <http://home.wxs.nl/~asmodai>;
Only in sleep can one find salvation that resembles Death...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001029151205.C88101>