diff options
author | dscho <dscho> | 2002-04-23 08:21:39 +0000 |
---|---|---|
committer | dscho <dscho> | 2002-04-23 08:21:39 +0000 |
commit | 49bfc728fab29bafaba49cf58867906390986852 (patch) | |
tree | b4afe80d4efec08aacdb6d793ac65c1221028dbd | |
parent | ab4126d1ec05d7c078ac7635aae339bd96ce7863 (diff) | |
download | libtdevnc-49bfc728fab29bafaba49cf58867906390986852.tar.gz libtdevnc-49bfc728fab29bafaba49cf58867906390986852.zip |
solaris endian changes
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | rfb.h | 15 |
2 files changed, 18 insertions, 2 deletions
@@ -34,7 +34,10 @@ MUTEX(logMutex); -char rfbEndianTest = (_BYTE_ORDER == _LITTLE_ENDIAN); +/* we cannot compare to _LITTLE_ENDIAN, because some systems + (as Solaris) assume little endian if _LITTLE_ENDIAN is + defined, even if _BYTE_ORDER is not _LITTLE_ENDIAN */ +char rfbEndianTest = (_BYTE_ORDER == 1234); /* * rfbLog prints a time-stamped message to the log file (stderr). @@ -62,9 +62,22 @@ typedef unsigned long KeySym; #include <machine/endian.h> #define _BYTE_ORDER BYTE_ORDER #define _LITTLE_ENDIAN LITTLE_ENDIAN -#elif sparc +#elif defined (__SVR4) && defined (__sun) /* Solaris */ +#include <sys/types.h> +#if defined(__sparc) + /* SPARC here (big endian) */ +#ifndef _BIG_ENDIAN +#define _BIG_ENDIAN 4321 +#endif +#define _BYTE_ORDER _BIG_ENDIAN +#elif defined(__i386) +#ifndef _LITTLE_ENDIAN #define _LITTLE_ENDIAN 1234 +#endif #define _BYTE_ORDER _LITTLE_ENDIAN +#else +#error Solaris 2.5.1 had ppc support did it not? :-) +#endif #undef Bool #define Bool char #undef SIGNED |