[Zlib-devel] ZLIB_VERSION calculation proposal

Andrei Polushin a-polushin at mail.ru
Mon Sep 27 11:44:39 EDT 2004


Hello,

I would like to propose version calculation mechanism for zlib. The idea is
to split version macros into separate parts, and then calculate original
values. The direct objective is to simplify maintenance of Win32 build,
which require different form of version representation (separated by
commas). If the patch were accepted, we will be able to rewrite .rc files in
win32 directory in a way that they will not require version maintenance.

With best regards,
// Andrei Polushin

diff -c3 zlib-1.2.1.2/zlib.h zlib/zlib.h
*** zlib-1.2.1.2/zlib.h Fri Sep 10 12:50:14 2004
--- zlib/zlib.h Mon Sep 27 22:12:57 2004
***************
*** 37,44 ****
  extern "C" {
  #endif

! #define ZLIB_VERSION "1.2.1.2"
! #define ZLIB_VERNUM 0x1212

  /*
       The 'zlib' compression library provides in-memory compression and
--- 37,59 ----
  extern "C" {
  #endif

! #define ZLIB_VERSION_MAJOR      1
! #define ZLIB_VERSION_MINOR      2
! #define ZLIB_VERSION_MICRO      1
! #define ZLIB_VERSION_REVISION   2
!
! #define ZLIB_STR(x)             #x
! #define ZLIB_EVAL_STR(x)        ZLIB_STR(x)
!
! #define ZLIB_VERSION            ZLIB_EVAL_STR(ZLIB_VERSION_MAJOR) "." \
!                                 ZLIB_EVAL_STR(ZLIB_VERSION_MINOR) "." \
!                                 ZLIB_EVAL_STR(ZLIB_VERSION_MICRO) "." \
!                                 ZLIB_EVAL_STR(ZLIB_VERSION_REVISION)
!
! #define ZLIB_VERNUM             (((ZLIB_VERSION_MAJOR) * 0x1000) + \
!                                  ((ZLIB_VERSION_MINOR) * 0x100) + \
!                                  ((ZLIB_VERSION_MICRO) * 0x10) + \
!                                   (ZLIB_VERSION_REVISION))

  /*
       The 'zlib' compression library provides in-memory compression and






More information about the Zlib-devel mailing list