Small LSB hacks
authorHarald Fernengel <harald.fernengel@nokia.com>
Tue, 13 Mar 2012 20:34:05 +0000 (21:34 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 15 Mar 2012 10:27:26 +0000 (11:27 +0100)
Enable building QtDeclarative with the LSB compiler

Change-Id: I3a81247670f47db3d861910150a722bc8ac7691a
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/qml/qml/qqmltypeloader.cpp

index 36ba530..781915e 100644 (file)
 #include <dirent.h>
 #endif
 
+#if defined (QT_LINUXBASE)
+// LSB doesn't declare NAME_MAX. Use SYMLINK_MAX instead, which seems to
+// always be identical to NAME_MAX
+#ifndef NAME_MAX
+#  define NAME_MAX _POSIX_SYMLINK_MAX
+#endif
+
+// LSB has a broken version of offsetof that can't be used at compile time
+// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3462
+#undef offsetof
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+#endif
+
 // #define DATABLOB_DEBUG
 
 #ifdef DATABLOB_DEBUG