>>>> "SJT" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
SJT> 2000-08-02 Stephen J. Turnbull <stephen(a)xemacs.org>
SJT> * configure.in: Check for NAS_BIG_ENDIAN in <audio/fileutil.h>.
SJT> src/Changelog:
SJT> 2000-08-02 Stephen J. Turnbull <stephen(a)xemacs.org>
SJT> * nas.c: Make manipulation of *_ENDIAN macros conditional on
SJT> NAS_USES_OWN_NAMESPACE (cf. 2000-07-29 Edwin Wiles patch)
SJT> * config.h.in: Added NAS_USES_OWN_NAMESPACE.
Although I love configure, I don't love adding new configure tests.
So I asked myself if this could be done only using cpp (I also love
cpp!). And I think so.
Why can't nas.c do simply (untested)
#include <system headers>
/* unconditionally - we don't use the libc values */
#undef BIG_ENDIAN
#undef LITTLE_ENDIAN
#include <nas_headers>
#if defined (BIG_ENDIAN) && ! defined (NAS_BIG_ENDIAN)
#define NAS_BIG_ENDIAN BIG_ENDIAN
#endif
#if defined (LITTLE_ENDIAN) && ! defined (NAS_LITTLE_ENDIAN)
#define NAS_LITTLE_ENDIAN LITTLE_ENDIAN
#endif
This only requires, for complete safety, that the nas headers are included last.