Compiling with g++ (from Makefile generated with qmake) using the line
#if !QT_CONFIG(printer)
// do something
#endif
gives a preprocessor error on both g++ (7.3.0)
test.cpp:25:6: error: division by zero in #if
#if !QT_CONFIG(printer)
and clang (6.00)
test.cpp:25:6: error: division by zero in preprocessor expression
#if !QT_CONFIG(printer)
^~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:84:30: note: expanded from macro 'QT_CONFIG'
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
~^~~~~~~~~~~~~~~~~~~~~
1 error generated.
where clang++ gives the more detailed output. printer
is not enabled, thus the macro as recommended to do conditional compilation. The QT version is 5.9.5. Any suggestions (wrong usage?) appreciated.