[omniORB] Endianness

Brent Fulgham bfulgham@xpsystems.com
Wed, 21 Apr 1999 10:34:53 -0700


I received a complaint from a fellow Linux developer that the header files
for omniORB do not detect processor endianness.  After looking into it, I
realized that gcc/g++ under Linux define "__i386__", while the
omniORB2/CORBA_sysdep.h header file looks for "__x86__".

I was wondering if anyone running on other i386-based OS's, or even other
Linuxes could comment on whether this has been a problem for them.

My planned workaround is to add the lines:
#ifdef __i386__
#define __x86__
#endif

To the Debian version of the files.  If this is useful for others I would
like to see it placed in the upstream sources.

As an alternative, we could also use the GNU C Library #include <endian.h>,
which will define __LITTLE_ENDIAN, __BIG_ENDIAN, or __PDP_ENDIAN.  Perhaps
any of these Macros could be used to set _OMNIORB_HOST_BYTE_ORDER for
systems running under the GNU C Library.

Thanks,

-Brent