Mail Archives: djgpp/1997/03/13/13:34:20
Jon A. Cruz wrote:
> I was intentionally vauge to begin with. I wanted to get good answers to
> what I need, not what I ask.
If you don't ask for what you need, you're likely not going to get it.
> I have two main questions in my head 1) what are commonly used defines
> (spelling), and 2) what are things that need to be watched for?
You can use whatever defines you like, and there isn't any universally or
even commonly used agreement.
> I have been looking at these items:
>
> * OS
> * compiler bugs (Hey, I'm using MS compilers, 'nuff said)
Just have macros specifying which OS and compiler you're using.
> * byte order
Have LITTLE_ENDIAN and BIG_ENDIAN, and have them do the appropriate thing
in your high-level I/O routines.
> * size of types
As I said earlier, just make OS/compiler-dependent macros that specify
16-bit signed types, 16-bit unsigned types, etc.
> * 64k pointer limit
Don't know what you think you could do about this. Are you talking about
near pointers in MSDOS?
> * text/binary mode for files
This is already handled for you by stdio; just open it as text or binary,
appropriately, when calling fopen.
> I don't want to say things like "#ifdef __INTEL__" all down in my code,
> but more like "#ifdef __BIG_ENDIAN__" or "#if _BYTE_ORDER = _BIG_ENDIAN"
You can either do all the preprocessing in one header file where it makes
macros that do the appropriate thing on your platform, or you can have the
condition compilation occur in the code. Either way it's the same thing.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -