marmalade / OpenQuick

Marmalade Open Quick
113 stars 24 forks source link

Error compiling QAtlas.cpp #6

Open ghost opened 11 years ago

ghost commented 11 years ago

Getting the following compilation error:

../../source/QAtlas.cpp:182:65: error: macro "QAssert" passed 3 arguments, but takes just 2
timcloss commented 11 years ago

Hmm... OK that's a bug in our support for using OpenQuick outside of Marmalade.

In QDefines.h you will see the following code:

#define QAssert(cond, msg) CCAssert(cond, msg)
#define QTrace CCLOG
#define QWarning CCLOG

You need to define a version of QAssert that can take 3 arguments. This will probably mean changing it to an inline function, where the 3rd argument can default to being empty. You could then strcat the 2nd and 3rd arguments (if the 3rd argument exists) before passing on to CCAssert.

Does that make sense?

sbc100 commented 11 years ago

Unfortunately it is not that simple. I fixed the issue with this change:

https://github.com/sbc100/OpenQuick/commit/56162cb596d9f86c69e339ece1ad9a8ed6a2c2e9

As far as I can tell the marmalade version should also be converted to use a macro otherwise you loose all file/line/function information.