[Zlib-devel] ZLIB_VERSION calculation proposal

William A. Rowe, Jr. wrowe at rowe-clan.net
Mon Sep 27 11:57:31 EDT 2004


+1 Andrei, we do something similar in Apache httpd, but rewrite
the version string into an .rc script using awk.

This seems more trivial.

Bill

At 10:44 AM 9/27/2004, you wrote:
>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
>
>
>
>_______________________________________________
>Zlib-devel mailing list
>Zlib-devel at madler.net
>http://madler.net/mailman/listinfo/zlib-devel_madler.net






More information about the Zlib-devel mailing list