diff --git a/base/QtMain.cpp b/base/QtMain.cpp index 6a23895f21..63b5748a08 100644 --- a/base/QtMain.cpp +++ b/base/QtMain.cpp @@ -13,7 +13,7 @@ #ifdef __SYMBIAN32__ #include #endif -#ifdef Q_WS_X11 +#if defined(Q_WS_X11) && !defined(USING_GLES2) #include "mainwindow.h" #endif #include "QtMain.h" @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) NativeInit(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE"); #endif -#ifdef Q_WS_X11 +#if defined(Q_WS_X11) && !defined(USING_GLES2) MainWindow mainWindow; mainWindow.show(); #else diff --git a/ext/cityhash/city.cpp b/ext/cityhash/city.cpp index 34d7edca6d..64a12a42f9 100644 --- a/ext/cityhash/city.cpp +++ b/ext/cityhash/city.cpp @@ -30,6 +30,7 @@ #include "city.h" #include +#include // To check for glibc #include // for memcpy and memset using namespace std; @@ -47,27 +48,30 @@ static uint32 UNALIGNED_LOAD32(const char *p) { } #ifdef _MSC_VER - -#include #define bswap_32(x) _byteswap_ulong(x) #define bswap_64(x) _byteswap_uint64(x) - +#elif defined(__GLIBC__) +#include #elif defined(__APPLE__) - // Mac OS X / Darwin features #include #define bswap_32(x) OSSwapInt32(x) #define bswap_64(x) OSSwapInt64(x) - -#elif defined(__SYMBIAN32__) || defined(BLACKBERRY) -//TODO: I'm not really sure if this is the fasters or the safest way to do this. However both platforms should have qendian which should map swap-functions -#include -#define bswap_32(x) qbswap((qint32)x) -#define bswap_64(x) qbswap((qint64)x) #else - -#include - +// Otherwise it doesn't exist (Symbian, Blackberry10) +#define UINT64_C(c) static_cast(c ## ULL) +#define bswap_32(x) (0 | ((x & 0x000000ff) << 24) \ + | ((x & 0x0000ff00) << 8) \ + | ((x & 0x00ff0000) >> 8) \ + | ((x & 0xff000000) >> 24)) +#define bswap_64(x) (0 | ((x & UINT64_C(0x00000000000000ff)) << 56) \ + | ((x & UINT64_C(0x000000000000ff00)) << 40) \ + | ((x & UINT64_C(0x0000000000ff0000)) << 24) \ + | ((x & UINT64_C(0x00000000ff000000)) << 8) \ + | ((x & UINT64_C(0x000000ff00000000)) >> 8) \ + | ((x & UINT64_C(0x0000ff0000000000)) >> 24) \ + | ((x & UINT64_C(0x00ff000000000000)) >> 40) \ + | ((x & UINT64_C(0xff00000000000000)) >> 56)) #endif #ifdef WORDS_BIGENDIAN