Please include architecture define in cpp
Casey Leedom
casey at admin.cognet.ucla.edu
Thu Nov 10 17:59:30 AEST 1988
Sorry for taking so long to get back to this subject. I've been totally
snowed under with a number of things, including my continuing efforts to
get X.V11R3 compiled under SR10, but more on that in a later letter ...
Thanks to Larry Allen <lwa at apollo.com>, Leonard Zubkoff
<lnz at LUCID.COM>, and Ellis Jones <oj at apollo.COM> for information about
the Apollo compiler predefined defines m68000 (apparently for back
compatibility with previous releases of Apollo's development system), and
_ISP__M68K and _ISP__A88K under Apollo's new release, SR10.
These defines do indeed allow me to determine the architecture of the
machine I'm compiling on so I can do the ``right thing'' for byte
ordering dependencies in structures for things like network independent
data, etc. And, as was pointed out by Leonard Zubkoff,
``The PRISM architecture is indeed big-endian; since Apollo is
firmly committed to binary compatibility of data files, it would
be very hard to change this in future architectures without
losing that binary compatibility.''
it turns out not to matter too much. Or rather, ``#ifdef apollo'' can
probably be taken as the same as ``#ifdef BIG_ENDIAN'' for the rest of
time (but I still prefer to ifdef on particular architectures to be
safe).
But a question pops into my mind at this point: are these predefined
defines defined anywhere? That is, does ANSI C define them? Obviously
it couldn't define all of them because new architectures will be brought
to market, etc. A set of standard ANSI C predefined architecture defines
would in fact almost seem to be the perfect thing to add to a new section
of the Assigned Numbers RFC that the NIC maintains. Does anyone have any
information on this?
Casey
P.S. I'm prompted to this question because 1. I've seen most compilers
use "mc68000", not "m68000", and 2. the _ISP... defines look very
ANSI Cish ...
More information about the Comp.std.c
mailing list