Answer the question
In order to leave comments, you need to log in
What is the correct way to write this macro in C++/Qt?
In general, there is such a primitive overlap construction
#ifdef QT_DEBUG
#define __DEBUG(A, B) qDebug() << PLACE(A) << B;
#else
#define __DEBUG(A, B)
#endif
Its essence is that if you compile the project in debug mode, then the macro works and the corresponding value is substituted, but if you compile in Release mode, then the macro does not substitute anything. Question: how to correctly implement such a construction without varnings?
/defines.h:55: warning: "__DEBUG" redefined [enabled by default]
#define __DEBUG(A, B) qDebug() << PLACE(A) << B;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question