This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
You should look through your system headers more -- there are
several places on my machine (a BSD4.4 variant) where BIG_ENDIAN is
defined to be 4321:
[/tmp] bungi@mungi: grep 4321 /usr/include/**/*.h | grep -v endian.h
/usr/include/arpa/nameser.h:#define BIG_ENDIAN 4321 /*
most-significant byte first (IBM, net) */
/usr/include/netiso/esis.h:#define BIG_ENDIAN 4321 /*
most-significant byte first (IBM, net) */
/usr/include/netiso/tp_tpdu.h:#define BIG_ENDIAN 4321 /*
most-significant byte first (IBM, net) */
-tim
Begin forwarded message:
From: Alex Buell <alex.buell@tahallah.demon.co.uk>
Date: 1999-02-05 17:56:47 -0800
To: Linux Egcs <egcs@cygnus.com>
Subject: A oddity... can anyone explain this?
Mailing-List: contact egcs-help@egcs.cygnus.com; run by ezmlm
Delivered-To: mailing list egcs@egcs.cygnus.com
X-Sender: alex@tahallah.demon.co.uk
Compile this little file with egcs-1.1.1.
#include <stdlib.h>
typedef enum
{
BIG_ENDIAN,
LITTLE_ENDIAN
} ENDIAN_TYPE;
main()
{
}
It comes up with:
tahallah[alex]:/home/alex/src/test > gcc endian.c -o endian
endian.c:5: parse error before `4321'
I did a quick grep around and found a whole bunch of BIG_ENDIAN defines in
the includes, but the odd thing was that they were all prefixed with __.
This is from endian.h in /usr/include.
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#define __PDP_ENDIAN 3412
I'm at a loss as to why this should generate an compiler error when my
definitions aren't prefixed with '__'.
Cheers,
Alex
--
/\_/\ Legalise cannabis now!
( o.o ) Grow some cannabis today!
> ^ < Peace, Love, Unity and Respect to all.
http://www.tahallah.demon.co.uk - *new* - Leaving the States for good!