Commit Graph

152 Commits

Author SHA1 Message Date
Stephen Kelly
fae95d5da3 Test that Qt tools can handle ' as a digit separator.
Change-Id: I0a3446d02184989c32367e66d4f5d9e464a56ec6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-30 09:44:07 +01:00
Morten Johan Sørvig
89ef515177 Add JSON parsing support to qmake.
Add qjson* implementation files from corelib/json
to the qmake build. Add a read-only compile mode,
enabled by defining QT_JSON_READONLY.

Add qmake built-in function parseJson(file, into)
which parses a json file into the given variable.

qmake uses a flat key -> value-list implementation
for storing variables, which means that some hackery
is need to represent arbitrarily nested JSON. Use a
special "_KEYS_" variable for arrays and objects:

Arrays:
["item1", "item2"]
$${array._KEYS_} -> 0 1 2
$${array.0} -> "item1"
$${array.1} -> "item2"

Objects:
{ "key1" : "value1", "key2" : "value2" }
$${object._KEYS_} -> key1 key2
$${object.key1} -> value1
$${object.key2} -> value2

Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-17 08:07:25 +02:00
Stephen Kelly
72d6717b26 moc: Don't stumble over MSVC __declspec.
Commit 310031188c (Fix moc stumbling over gcc __attribute__
extensions, 2012-10-01) applied similar logic for GNU style
attributes.

Change-Id: I550eaefd703b4e974e6ffae7716f02074c8a8823
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-24 10:09:14 +02:00
Richard Moe Gustavsen
31b4461097 moc: add -M<key=value> to ease static qml plugin linking
A module plugin in qml belongs to a URI/namespace. This
uri is resolved run-time by QtDeclarative by knowing the
path of the qmldir that references the plugin.
For static plugins this becomes a problem, since we lost
the information regarding which plugin belongs to which
qmldir, since a static plugin has no file path.

To avoid pushing the responsibility of clarifying this
onto the application developer, it is better to embed this
information into the meta data of the plugins themselves.
Since this information can be resolved by the
build system, a new option to moc has been added:
-M<key=value>
that will let you add meta tags to the meta data from
the command line to each class that has an IID specified.
For the URI case, we can then e.g do:
-Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private

Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:48:08 +02:00
Frederik Gladhorn
190fa97c83 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	examples/widgets/doc/src/addressbook-fr.qdoc

Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
2013-08-27 22:51:09 +02:00
Olivier Goffart
8a96679493 moc generated code should compile with QT_NO_KEYWORDS
Don't use the 'emit' keyword in the moc generated code for properties
with MEMBER

Task-number: QTBUG-33094
Change-Id: I5a0950e9c7a0dee347a6a6c79098e3e7d4776014
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-22 16:03:28 +02:00
Olivier Goffart
2bd40c53ef moc: Fix related objects containing itself
This may happen when we have namespaces and the qualified name is used
to scope an enum.

Task-number: QTBUG-32933
Change-Id: Ic4923bbfb138387bae1e3694172661ace8342089
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-22 16:03:28 +02:00
Olivier Goffart
c20b358703 moc: Issue a warning instead of an error when macro argument mismatch
moc's C++ is not 100% accurate, so better process the invalid macro with
a warning rather than an error.

Such errors occurred in the QSKIP macro with variadic arguments since
that macro is defined conditionally.
It is also causing problem in boost header (cf task QTBUG-29331)

Task-number: QTBUG-29331
Change-Id: Ice6a01b675286540d6470c8e36920b7efd39b540
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-22 07:11:33 +02:00
Sergio Ahumada
7978cef796 tests: Make the QT assignments more explicit
Remove unused 'QT -= gui' and replace some others with
'QT = core ...'

Change-Id: I2d14fae963afc21dbd21a4acdbba2c30cdf8fa61
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-21 19:05:52 +02:00
Oswald Buddenhagen
b4c0d9166e change reporting of missing files
use the new parser flags to report all i/o errors directly.

as a notable side effect, the "WARNING" prefix is gone (even though
it is still treated like that, which is mildly insane to start with).

Change-Id: I084375d5e7a3314ae763795f7c318804a9fb84b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-08-20 22:56:12 +02:00
Frederik Gladhorn
5c23199d4e Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	mkspecs/macx-xcode/Info.plist.app
	mkspecs/macx-xcode/Info.plist.lib
	qmake/doc/qmake.qdocconf
	src/corelib/global/qglobal.h
	tests/auto/other/exceptionsafety/exceptionsafety.pro
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp

Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
2013-08-14 09:06:31 +02:00
hjk
3c2c9649eb RCC: Make auto-test pick up the right binary
Change-Id: I30f42d40c69789eb1e292ab6bd1cf2c09d81b11b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-13 17:24:49 +02:00
David Faure
cfb5dfb7e8 moc: add unittest for --ignore-option-clashes
Based on tst_Moc::frameworkSearchPath().

Change-Id: I4f44f98d62acc1a2a92739cceba731dcb5f661b6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-07-30 09:36:25 +02:00
Oswald Buddenhagen
783181cfc1 make split_value_list() even less sane again
contrary to what one may expect, it's actually *not* supposed to remove
the meta-characters it interprets.

luckily, this function is not used much any more ...

Task-number: QTBUG-31877
Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-03 21:38:37 +02:00
Oswald Buddenhagen
bc328f8ec3 remove nonsense DEFINES
Change-Id: Ie079c52eb800878983501b9fe2b2f6c27df0cdb1
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-03 21:38:37 +02:00
Sergio Ahumada
55b933e6fb test: Skip tst_qmake::include_dir() when -no-widgets is used
Only run this test case when the widgets module is present, skip it
otherwise.

Change-Id: I84f48b670b967af3bf0701ceba5a192f33989034
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-06-24 11:23:48 +02:00
Oswald Buddenhagen
69fa0012c7 use qtconcurrent instead of qtgui in test code
this works with -no-gui, and doesn't interfere with our upcoming ANGLE
hackery.

Change-Id: I2985cc0acd1fbf185b8967ffe58606b1b7dd9d1e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-06-10 21:12:01 +02:00
Olivier Goffart
e63b831bbd moc: Fix Generator::registerableMetaType
when the type is a pointer to a registerable 1 argument template type.

Task-number: QTBUG-31002
Change-Id: Iac0d6b71b2b805a1876110a0781d02188083c4e5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-20 12:06:48 +02:00
Olivier Goffart
208e9a2757 moc: recover bad template parsing.
When encountering code such as:
  X<a<b>
moc does not have the mean to know if 'a' is a type or a variable, so the
type parser currently assume that '<' always open a template parameter.
(instead of being the operator<)

The type parser do not care about the actual type, it just need to strip
the string out. The problem is that then the whole rest of the file will
be considered as the type.

With this patch, we also stop the parsing at semicolon.  The type will
be wrong, but this allow the parser to recover and it will continue to
look for more classes after this.

(In other words, moc will no longer break if it encounter such construct
in a header. But it will still not parse such types correctly if used
within a Q_OBJECT class)

Task-number: QTBUG-31218

Change-Id: I1fef6bc58493d7c00df72401c9ad55463b24eaa7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-20 10:06:04 +02:00
Olivier Goffart
263b86a559 moc: use fprintf instead of qWarning
qWarning now depends on QT_MESSAGE_PATTERN, depending on that variable.
It will show things like the moc process id or the Parser::error
function name.  We don't want that.

Change-Id: I5b35401200f0f7de2442aa77d700a82402081489
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-08 00:55:15 +02:00
Sergio Ahumada
d64274d4ff test: Disable tst_uic when -no-widgets is used
uic doesn't get compiled when -no-widgets is used, so disabling
its test.

Change-Id: I8c81ec468e40841548dacb356fd87ecf85d7b6ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-22 16:24:44 +02:00
Oswald Buddenhagen
76c0be34cd Merge branch 'dev' into stable
This starts Qt 5.1 release cycle

Conflicts:
	src/gui/text/qfontdatabase.cpp
	src/gui/text/qharfbuzz_copy_p.h
	src/widgets/kernel/qapplication.cpp
	src/widgets/kernel/qcoreapplication.cpp

Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
2013-03-20 13:49:28 +01:00
Olivier Goffart
b8d08c0e9a Fix tst_moc when variadic macros are enabled
moc do not see Q_COMPILER_VARIADIC_MACROS as defined (because it does
not know the builtins defines)

So it would never parse those macro, and never generate the signals or
slot.

Always let moc parse the variadic macro, and put non-macro function in
the header so the generated code would compile on every compiler

Change-Id: Ie9504539ee737c81e831b217f8d623fe810d9e35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-17 10:57:49 +01:00
Axel Waggershauser
b11317a643 Whitespace cleanup: remove trailing whitespace
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.

Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp

Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.

Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-16 20:22:50 +01:00
Frederik Gladhorn
5e8ae03578 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/kernel/qtimerinfo_unix.cpp
	src/plugins/platforms/cocoa/qcocoabackingstore.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp

Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
2013-03-05 13:42:11 +01:00
Olivier Goffart
7e5d1c1c2f moc: Support the '$' character as an identifier
Both gcc and clang allow the use of '$' in their identifiers as an
extension. moc should not throw a parse error if there is one in the
file. Instead, consider '$' as valid in identifiers.

Task-number: QTBUG-22720
Change-Id: I8be3a52429c0db5b7e8308b8f4fe475d3d3994bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Olivier Goffart
b0e58a9008 Fix compilation of moc generated file with MEMBER properties
If the object has only MEMBER properties, without any other property
specifying READ, the generated will fail to compile with this error:

tst_moc.moc: In member function ‘virtual int ClassWithOneMember::qt_metacall(QMetaObject::Call, int, void**)’:
tst_moc.moc:3810:42: error: ‘_v’ was not declared in this scope

That's because the '_v' is only declared if 'needTempVarForGet' is set,
and it should be set when we have a MEMBER property.

Change-Id: I829fad3faf69654b5a3fd540857df19f4a9449d4
Reviewed-by: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Olivier Goffart
b05f19f232 moc: Fix infinite recursion in macro substitution
When performing macro argument substitution, one should keep the set of
macro to exclude, else we can enter an infinite recursion.

Testcase:
 #define M1(A) A
 #define M2 M1(M2)

Task-number: QTBUG-29759
Change-Id: I564bbfed65e1c8599592eaf12c6d67285d2fd9ce
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-02-21 16:55:41 +01:00
Tor Arne Vestbø
443380d97f Don't run qmake test that requires macx makespec on non Mac OS platforms
And update test to use the clang makespec now that it's the default.

Change-Id: Ifdd34c4220ad76f60b91fd6ef39d189f0f6525f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-20 00:46:50 +01:00
Tor Arne Vestbø
eb09f9b82c moc: Error out when detecting unterminated macro usage
Exhausting the symbol list while looking for the
final right parenthesis means it is missing.

Task-number: QTBUG-29308
Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-19 20:51:44 +01:00
Tor Arne Vestbø
3988ad95f7 moc: Error out when detecting unterminated macro usage
Exhausting the symbol list while looking for the
final right parenthesis means it is missing.

Task-number: QTBUG-29308
Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-19 07:55:39 +01:00
Frederik Gladhorn
e65cd6f379 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/concurrent/doc/qtconcurrent.qdocconf
	src/corelib/doc/qtcore.qdocconf
	src/corelib/global/qglobal.h
	src/dbus/doc/qtdbus.qdocconf
	src/dbus/qdbusmessage.h
	src/gui/doc/qtgui.qdocconf
	src/gui/image/qimagereader.cpp
	src/network/doc/qtnetwork.qdocconf
	src/opengl/doc/qtopengl.qdocconf
	src/opengl/qgl.h
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/printsupport/doc/qtprintsupport.qdocconf
	src/sql/doc/qtsql.qdocconf
	src/testlib/doc/qttestlib.qdocconf
	src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf
	src/widgets/doc/qtwidgets.qdocconf
	src/xml/doc/qtxml.qdocconf

Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
2013-02-14 14:24:57 +01:00
Sze Howe Koh
26817211d2 Fix module name format in displayed code
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtDBus       -> Qt D-Bus
QtMultimedia -> Qt Multimedia
QtWidgets    -> Qt Widgets

Change-Id: I96a1523b37e294b10b203782074943c6ec55e34a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 01:43:21 +01:00
Friedemann Kleint
8138a09e05 Replace SRCDIR-define by QFINDTESTDATA in tst_moc.
Remove srcify() function, which was warned about as unused
on Windows.

Change-Id: I731d3b6f058d4246e39dcf9a137619ae5087d751
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 22:14:27 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Gerhard Gappmeier
9bbebb9144 Add support for defining properties from member variables.
This associates properties with member variables and
avoids writing getter and setter methods manually.
The metaCall() method directly accesses the member variable,
so additional method calls can be avoided.
The metaCall() setter code also supports NOTIFY signals,
which means the according signal is emitted when the property
gets written.

Task-number: QTBUG-16852

Change-Id: I88a1f237ea53a1e9cf65fc9ef2e207718eb8b6c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-19 17:36:55 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Stephen Kelly
21d607c81a Automatically register method types in QSignalSpy.
Change-Id: I3655291dca6dbd3d8d09ee835b85983caa911b64
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-07 12:06:00 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Oswald Buddenhagen
09331062bb remove some unnecessary CONFIG additions
qt is already added by spec_pre.prf, warn_on and depend_includepath by
default_pre.prf.

Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-17 14:08:17 +01:00
Liang Qi
139f416237 Remove the timestamp info in genarated files
For moc, rcc and uic, then it's friendly for tools like ccache.
ccache is using md5 to check file modification, but the different
timestamp info will cause different md5 for same meaningful
contents, it will disabled ccache.

Updated the autotest for uic and rcc.

Task-number: QTBUG-26589
Change-Id: I9f1dcf6cd826ad9603af6e183757bcd748c32bd1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-15 11:32:38 +01:00
Konstantin Ritt
b34c48d95b qmake: Test recursive function calls
Change-Id: If7d659728d30b2e5c52082ab999bc00de3733972
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-11-26 14:30:09 +01:00
Lars Knoll
aea68c93ae Proper macro replacment and branch evaluation
Correclty replace macros according to the C++ standard.
Use the correct replacement method also to evaluate

With this moc correctly processes boost headers.

Task-number: QTBUG-27546

Change-Id: I001b3054c5fcdc34d46cfa53d1387bd19436f361
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-11-23 17:04:00 +01:00
Thorbjørn Lund Martsum
37eb61677c uic - fix to handle QTreeWidget with empty header(s)
This makes it possible for uic to handle QTreeWidget that in
the designer has one or more empty headers.

Before the right(most) empty items where there wasn't a
non-empty header to the right of them would not be visible.

The other empty items - where there was a header to the
right of it would not be empty but initialized with a number.

This patch ensures the same behavior that the QTableWidget
is having.

Task-number: QTBUG-18156

Change-Id: I19bfd3307befe46a1af2d6a3275f7446a15b3442
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-21 16:36:50 +01:00
Simon Hausmann
f45d6414ad Fix qmake's pro file cache to interact correctly with write_file
When writing a file with write_file() we have to inform the pro file parser
cache to discard the file if it's existant in the cache, to ensure that
calling include() after write_file() always works.

Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-10-25 16:22:00 +02:00
Olivier Goffart
21426f281e moc: parse properly the gcc extension for variadic macro
Task-number: QTBUG-27547

Change-Id: I983b96b09c405e5330327092e56164b9921a2d0f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-14 20:53:42 +02:00
Simon Hausmann
9ab8c0ae98 Fix moc preprocessor-only mode with input that contains seemingly invalid identifiers
In WebKit we use moc -E to pre-process various files before throwing at
further build creation tools. The pre-processing is used to filter out
code depending in #ifdef'fed features.

The latest addition to the family of pre-processed files is the CSS grammar,
which is written in Bison. It contains rule lines like

   $$ = parser->createFoo()

and when pre-processing this moc stumbles over the dollar sign. Instead
of ignoring un-tokenizable input we should add it to the current token
if we're in preprocessor-only mode, otherwise the $$ gets eaten and we
produce data-loss by printing out less characters than.

Change-Id: Ib32e7c04b38dd2ba3726201e76f27405f7ea6c0d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-13 05:51:19 +02:00
Friedemann Kleint
274c258521 Use jom in tst_qmake.
Speed up compiling the tests.

Task-number: 26023

Change-Id: Ib5e872cc6cde09ac90f426a8f6e7cfea509d02e2
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-08 08:46:21 +02:00
Friedemann Kleint
8924506992 Increase tst_qmake more time on Windows.
The test compiles examples, which takes a long time.

Task-number: 26023
Change-Id: If794b046aa07737f3076aace8d585dc44027cc6b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-08 08:46:07 +02:00
Simon Hausmann
310031188c Fix moc stumbling over gcc __attribute__ extensions
Reported by David Faure.

In KDE a DEPRECATED macro gets defined in a header file created by cmake.
The define is not guarded with #if Q_CC_GNU or similar because at cmake
time the compiler is determined. Therefore moc suddenly sees this gcc
specific token and stumbles over it.

This patch simply defines an empty __attribute__ macro that will expand
to nothing and thus become invisible to moc's "C++ parser" after the
pre-processing.

Change-Id: I4448b9ac3f72b6334e32b27484401fb0fca23a0c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-01 14:27:14 +02:00