mirror of
https://github.com/woo-j/zint.git
synced 2024-12-23 13:33:55 +03:00
7e3d0f2405
The `__has_feature` macro is a clang extension that works like a macro. If zint is being compiled using a compiler other then clang, `__has_feature` is not defined. As it is not defined, it cannot be used as a function call expression. Any environment that doesn't have `__has_feature` should prevent the preprocessor from "seeing" the invokation of the macro, as invoking undefined macros is not supported by the C language. The usual procedure to assure this would be a construction like \#if defined(__has_feature) \# if __has_feature(...) \# endif \#endif which, combined with the GCC check we have here, would result in a 3 level nesting of if and elseif expressions .. and that's without covering microsoft's compiler. For this purpose, Qt >= 5.13 has been defining the `__has_feature` macro on non-clang environments, while defining all (clang) features to not be available. This allows to write feature checks with "less" nesting, as we have here. Mimic Qt-5.13's behavior and provide the `__has_feature` macro if it's not provided otherwise (either by clang or by Qt), allowing the function-call-like expression to be parsed on those systems. |
||
---|---|---|
.. | ||
tests | ||
backend_qt_zintdll.pro | ||
backend_qt.pro | ||
backend_vc8.pro | ||
CMakeLists.txt | ||
qzint.cpp | ||
qzint.h |