Project

General

Profile

Bug #509

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

Added by Andreas Huggel over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
miscellaneous
Target version:
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
  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 (diff)
Added by Andreas Huggel over 14 years ago

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

History

Also available in: Atom PDF