From 49b451dae44d801524288d16d8f45a3ef583275e Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 13 Mar 2012 21:34:05 +0100 Subject: [PATCH] Small LSB hacks Enable building QtDeclarative with the LSB compiler Change-Id: I3a81247670f47db3d861910150a722bc8ac7691a Reviewed-by: Roberto Raggi --- src/qml/qml/qqmltypeloader.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 36ba530..781915e 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -63,6 +63,19 @@ #include #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 -- 2.7.4