[Gllug] endian.h
Tethys
tet at accucard.com
Thu Feb 6 09:01:25 UTC 2003
Mike Brodbelt writes:
>As it seems I can't just substitute one include file for another, would
>it be cleaner to do "#ifdef LINUX" around the code segments in question
>and substitute the BSD macros with cpu_to_be16 and similar?
Rather than "#ifdef LINUX", use "#ifndef HAS_BETOH32", and have
autoconf (or similar) perform a configure-time check for its presence,
and define the appropriate things for your environment. In general,
you should never assume a given system (e.g., Linux) has particular
characteristics. It won't always be true, so you're better off
checking for that characteristic specifically.
Tet
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list