Bug #509
Version check macro doesn't work in a precompiler #if test anymore
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Before v0.14 this was valid
#if EXIV2_CHECK_VERSION(0,14,0)
In 0.14 this use of the macro is no longer valid.
Additional information:
Workaround: Add code like this to the application to define a EXIV2_TEST_VERSION macro which can be used in a preprocessor test with all versions of exiv2, instead of EXIV2_CHECK_VERSION:
#include <exiv2/types.hpp>#ifdef EXIV2_VERSION
- ifndef EXIV2_TEST_VERSION
- define EXIV2_TEST_VERSION(major,minor,patch) \
( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) - endif
#else - define EXIV2_TEST_VERSION(major,minor,patch) (false)
#endif
Added new function testVersion() and macro EXIV2_TEST_VERSION. Fixes #509.