From: Charles Lepple <clepple@mitre.org>
To: iweiny@pacbell.net
Cc: linuxdev <linuxppc-dev@lists.linuxppc.org>
Subject: Re: User level Macros for Endianess
Date: Wed, 12 Jan 2000 08:25:48 -0500 [thread overview]
Message-ID: <387C80DC.B6203081@mitre.org> (raw)
In-Reply-To: 200001120832.AAA10014@batcave2.localdomain
iweiny@pacbell.net wrote:
> What Macros should I be using to key off of for this? I have looked through
> /usr/include/endian.h and /usr/include/bits/endian.h. BYTE_ORDER (without the
> leading underscores) is only defined if __USE_BSD is defined. BOTH
> __BIG_ENDIAN and __LITTLE_ENDIAN are defined as are BIG_ENDIAN and
> LITTLE_ENDIAN. I'm so confused?
You can take advantage of the fact that "network byte order" is
big-endian, allowing you to use the hton?() and ntoh?() macros. I
realize that this is specific to a big-endian device (such as the camera
interface you have) but this is certainly easier than shoehorning an
existing project into the GNU autoconf model.
That said, you wouldn't want to use this hack for a new project -- an
autoconf-style test would be cleaner (IMHO). I would welcome any
suggestions, however.
--
Charles Lepple
clepple@mitre.org
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-01-12 13:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200001120832.AAA10014@batcave2.localdomain>
2000-01-12 9:11 ` User level Macros for Endianess Jesper Skov
2000-01-12 9:31 ` Gabriel Paubert
2000-01-12 13:25 ` Charles Lepple [this message]
2000-01-12 19:37 ` David A. Gatwood
[not found] <E869F6EDBD5F4E50C1256864006C9E10.006C9E4AC1256864@kehl.dalim.de>
2000-01-13 8:02 ` Stephane GEORGES
2000-01-13 15:48 ` David A. Gatwood
2000-01-13 16:18 ` Gabriel Paubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=387C80DC.B6203081@mitre.org \
--to=clepple@mitre.org \
--cc=iweiny@pacbell.net \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).