Problem with OFFIS_DCMTK_VERSION_NUMBER definition in dcmtk-3.6.0

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
poupofa
Posts: 2
Joined: Thu, 2011-01-20, 09:57
Location: Saclay, France

Problem with OFFIS_DCMTK_VERSION_NUMBER definition in dcmtk-3.6.0

#1 Post by poupofa »

Hello,

in version 3.6.0, OFFIS_DCMTK_VERSION_NUMBER becomes a string, and that prevents it to be used to adapt own developed applications to the API changes in DCMTK.
It is convenient to use a kind of #if OFFIS_DCMTK_VERSION_NUMBER >= 360 in some cases but this cannot be done with version 3.6.0. I checked the code and I did not find any definition that represents the DCMTK version as a pure number.

It is probably a small bug in the configure process, because the comments in dcuid.h specify that OFFIS_DCMTK_VERSION_NUMBER shall be the version number of the release, and OFFIS_DCMTK_VERSION_STRING shall represent this version number as a string.

I slightly modified the code to make OFFIS_DCMTK_VERSION_NUMBER back a number. Below are the changes I did (as diff of the files).


File config/configure:
1777c1777
- PACKAGE_VERSION_NUMBER="360"
---
+ PACKAGE_VERSION_NUMBER=360
1783c1783
- #define PACKAGE_VERSION_NUMBER "${PACKAGE_VERSION_NUMBER}"
---
+ #define PACKAGE_VERSION_NUMBER ${PACKAGE_VERSION_NUMBER}


File config/configure.in:
11c11
- PACKAGE_VERSION_NUMBER="360"
---
+ PACKAGE_VERSION_NUMBER=360
15c15
- AC_DEFINE_UNQUOTED(PACKAGE_VERSION_NUMBER,"${PACKAGE_VERSION_NUMBER}",[Define to the version number of this package.])
---
+ AC_DEFINE_UNQUOTED(PACKAGE_VERSION_NUMBER,${PACKAGE_VERSION_NUMBER},[Define to the version number of this package.])


File dcmdata/include/dcmtk/dcmdata/dcuid.h:
172c172,173
-
---
+ #define PACKAGE_VERSION_NUMBER_TO_STRING_( x ) #x
+ #define PACKAGE_VERSION_NUMBER_TO_STRING( x ) PACKAGE_VERSION_NUMBER_TO_STRING_( x )
174c175
- #define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME "OFFIS_DCMTK_" PACKAGE_VERSION_NUMBER
---
+ #define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME "OFFIS_DCMTK_" PACKAGE_VERSION_NUMBER_TO_STRING(PACKAGE_VERSION_NUMBER)
177c178
- #define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME2 "OFFIS_DCMBP_" PACKAGE_VERSION_NUMBER
---
+ #define OFFIS_DTK_IMPLEMENTATION_VERSION_NAME2 "OFFIS_DCMBP_" PACKAGE_VERSION_NUMBER_TO_STRING(PACKAGE_VERSION_NUMBER)


I used the preprocessor 'stringizing' character '#' to convert the version number 360 to a string instead of using 'PACKAGE_VERSION' to have a minimum impact on the other definitions because 'PACKAGE_VERSION' is set to "3.6.0" and not "360".


Hope that helps.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Thank you for the report and suggested fix. I've added this issue to our internal to-do list with priority "high", so it should be part of one of the next snapshot (aka version 3.6.1).

Btw, we changed the definitions and corresponding source code more than 2.5 years ago, so it was already present in the various snapshot versions (aka version 3.5.5) and nobody noticed it. That probably means that not so many people check the version number ...

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#3 Post by Jörg Riesmeier »

Just committed the required changes.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest