From b71cc64e5865bd79bd446a0ef49694f415d8921f Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 10 Oct 2015 12:12:38 +0200 Subject: [PATCH 1/2] Fix endianness detection Commit 97f442ef2aa65ade6bea11e90054c57b90abbaca tried to improve the endianness detection, but introduced a typo and problems for Windows builds (no endian.h, different definition of LIBVNCSERVER_WORDS_BIGENDIAN). Fix both issues. Signed-off-by: Stefan Weil --- rfb/rfbproto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h index 354f1aa..6921d4a 100644 --- a/rfb/rfbproto.h +++ b/rfb/rfbproto.h @@ -80,11 +80,12 @@ #endif #endif +#if !defined(_WIN32) # include # if __BYTE_ORDER == __BIG_ENDIAN -# define LIBVBNCSERVER_WORDS_BIGENDIAN 1 +# define LIBVNCSERVER_WORDS_BIGENDIAN 1 # endif - +#endif /* !_WIN32 */ /* MS compilers don't have strncasecmp */ #ifdef _MSC_VER From 68d43fb62dc9ecca7b32719464d7424c91ba70d7 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 10 Oct 2015 12:18:32 +0200 Subject: [PATCH 2/2] Fix definition of POSIX data types Commit 92f558482d94c5152174a1983a40863bd6b07911 added stdint.h to get the type definitions, but included it after the first use of int8_t in builds for Windows. Signed-off-by: Stefan Weil --- rfb/rfbproto.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h index 6921d4a..5061b6e 100644 --- a/rfb/rfbproto.h +++ b/rfb/rfbproto.h @@ -60,6 +60,7 @@ * messages have to be explained by comments. */ +#include #if defined(WIN32) && !defined(__MINGW32__) #define LIBVNCSERVER_WORDS_BIGENDIAN @@ -108,8 +109,6 @@ typedef int8_t rfbBool; #define TRUE -1 #endif -#include - typedef uint32_t rfbKeySym; typedef uint32_t rfbPixel;