diff options
author | Cosmin Truta <ctruta@gmail.com> | 2024-02-05 21:54:19 +0200 |
---|---|---|
committer | Cosmin Truta <ctruta@gmail.com> | 2024-02-05 21:54:19 +0200 |
commit | 920db2ecc08e92ee980599d5ee64e2d794ee49fa (patch) | |
tree | 69e88f7883ff88396cc9076cdbeda15104178129 | |
parent | cc8006c48d90cca8bf380fa69469b08f4edb00c5 (diff) | |
download | libpng-920db2ecc08e92ee980599d5ee64e2d794ee49fa.tar.gz |
api: Introduce the `PNG_LIBPNG_VER_SHAREDLIB` macro; update pngwin.rc
The version macros `PNG_LIBPNG_VER_SONUM` and `PNG_LIBPNG_VER_DLLNUM`
weren't always in sync, but they should be, going forward.
Or, better yet, we should keep them in, deprecated, and introduce
`PNG_LIBPNG_VER_SHAREDLIB` for all shared library builds of all kinds
on all platforms.
It is unknown how many user applications have been using these macros.
We have been using `PNG_LIBPNG_VER_DLLNUM` for pngwin.rc, for example.
Which, by the way, was last updated in 2009.
-rw-r--r-- | png.h | 9 | ||||
-rw-r--r-- | pngtest.c | 8 | ||||
-rw-r--r-- | scripts/pngwin.rc | 6 |
3 files changed, 11 insertions, 12 deletions
@@ -255,9 +255,6 @@ * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * - * DLLNUM will change each time there are forward or backward changes - * in binary compatibility (e.g., when a new feature is added). - * * See libpng.txt or libpng.3 for more information. The PNG specification * is available as a W3C Recommendation and as an ISO/IEC Standard; see * <https://www.w3.org/TR/2003/REC-PNG-20031110/> @@ -281,8 +278,10 @@ #define PNG_LIBPNG_VER_STRING "1.6.43.git" #define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n" -#define PNG_LIBPNG_VER_SONUM 16 -#define PNG_LIBPNG_VER_DLLNUM 16 +/* The versions of shared library builds should stay in sync, going forward */ +#define PNG_LIBPNG_VER_SHAREDLIB 16 +#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ +#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 @@ -52,10 +52,10 @@ typedef png_libpng_version_1_6_43_git Your_png_h_is_not_version_1_6_43_git; #if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \ PNG_LIBPNG_VER_MINOR * 100 + \ PNG_LIBPNG_VER_RELEASE) || \ - (PNG_LIBPNG_VER_SONUM != PNG_LIBPNG_VER_MAJOR * 10 + \ - PNG_LIBPNG_VER_MINOR) || \ - (PNG_LIBPNG_VER_DLLNUM != PNG_LIBPNG_VER_MAJOR * 10 + \ - PNG_LIBPNG_VER_MINOR) + (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_MAJOR * 10 + \ + PNG_LIBPNG_VER_MINOR) || \ + (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_SONUM) || \ + (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_DLLNUM) # error "Inconsistent version numbers in png.h" #endif diff --git a/scripts/pngwin.rc b/scripts/pngwin.rc index 9335cbbe0..87702a4fb 100644 --- a/scripts/pngwin.rc +++ b/scripts/pngwin.rc @@ -89,12 +89,12 @@ BEGIN #endif /* PNG_USER_VERSIONINFO_COMPANYNAME */ VALUE "FileDescription", "PNG image compression library\000" VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000" - VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) PNG_LIBPNG_DLLFNAME_POSTFIX " (Windows 32 bit)\000" - VALUE "LegalCopyright", "\251 1998-2009 Glenn Randers-Pehrson et al.\000" + VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_SHAREDLIB) PNG_LIBPNG_DLLFNAME_POSTFIX " (Windows)\000" + VALUE "LegalCopyright", "\251 1998-2024 PNG Reference Library Authors\000" #ifdef PNG_USER_VERSIONINFO_LEGALTRADEMARKS VALUE "LegalTrademarks", PNG_USER_VERSIONINFO_LEGALTRADEMARKS "\000" #endif /* PNG_USER_VERSIONINFO_LEGALTRADEMARKS */ - VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) PNG_LIBPNG_DLLFNAME_POSTFIX ".DLL\000" + VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_SHAREDLIB) PNG_LIBPNG_DLLFNAME_POSTFIX ".DLL\000" #ifdef PNG_USER_PRIVATEBUILD VALUE "PrivateBuild", PNG_USER_PRIVATEBUILD "\000" #endif /* PNG_USER_PRIVATEBUILD */ |