Bug #509

Version check macro doesn't work in a precompiler #if test anymore

Added by Andreas Huggel about 10 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:

0%

Category:miscellaneous
Target version:0.15

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
  1. ifndef EXIV2_TEST_VERSION
  2. define EXIV2_TEST_VERSION(major,minor,patch) \
    ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
  3. endif
    #else
  4. define EXIV2_TEST_VERSION(major,minor,patch) (false)
    #endif

Associated revisions

Revision 1121
Added by Andreas Huggel almost 10 years ago

Added new function testVersion() and macro EXIV2_TEST_VERSION. Fixes #509.

History

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux