| based on message posted on Sat, 20 Jul 2002 20:45:31 -0400 |
|---|
msg id 3D3A042BDOT3070107ATeceDOTgatechDOTedu sent to png-implementATccrcDOTwustlDOTedu From: Charles Wilson cwilsonATeceDOTgatechDOTedu |
entry points are *externally accessible* functions or variables exported by the DLL. The interface is the set of all these exported functions and variables in a given version of the library.
You ONLY need to bump PNGDLL if the new dll REMOVES an entry point that the old dll provided. If you ADD a new entry point, then the new dll is a drop-in replacement for the old one, since the new one provides everything the old one did.
Of course, an app compiled against the new version, which uses the additional entry points, won't work with the old dll — but nobody ever promised FORWARD compatibility, only BACKWARD compatibility.
This is the way Cygwin DLL versioning works:Updating libtool versioning:
Never try to set the interface numbers so that they correspond to the release number of your package. This is an abuse that only fosters misunderstanding of the purpose of library versions. Instead, use the -release flag (see Release numbers), but be warned that every release of your package will not be binary compatible with any other release.
So, here's an example: the libtool version is 5:4:3, which indicates revision 4 of the implementation of interface 5, which happens to be backwards compatible with the three previous interface definitions. (ie. it is safe for applications linked against interfaces 5, 4, 3 and 2 to load the 5:4:3 dll at runtime).
So, let's look at the likely history of the mystery dll. I am following the c:r:a update rules described above.
| oldest: interface definition 0, initial release: | ||
|---|---|---|
| 0:0:0 | (DLLVER = 0) | |
| removed an entry point: | ||
| 1:0:0 | (DLLVER = 1) | NOT backwards compatible!
but DLLVER does the right thing. |
| source code changed, but no added or removed entry points: | ||
| 1:1:0 | (DLLVER = 1) | |
| more source code changes: | ||
| 1:2:0 | (DLLVER = 1) | |
In all of the previous three releases, 'c' - 'a' = DLLVER = 1. |
||
| removed an entry point (or renamed it): | ||
| 2:0:0 | (DLLVER = 2) | This is INCOMPATIBLE.
(But look: 'c' - 'a' = 2, so the DLLVER does the right thing) |
| added a new function: | ||
| 3:0:1 | (DLLVER = 2) | (this is BACKWARDS but not FORWARDS compatible.
However, the DLLVER 'c' - 'a' still is 2, so that is good.) |
| add eight more exported functions all at once | ||
| 4:0:2 | (DLLVER = 2) | |
| add another function: | ||
| 5:0:3 | (DLLVER = 2) | |
| source code changes, but no new interfaces: | ||
| 5:1:3 | (DLLVER = 2) | |
| again: | ||
| 5:2:3 | (DLLVER = 2) | |
| again: | ||
| 5:3:3 | (DLLVER = 2) | |
| again: | ||
| 5:4:3 | (DLLVER = 2) | |
All of these DLLs with DLLVER = 2 (2:0:0, 3:0:1, 4:0:2, 5:0:3, 5:1:3, 5:2:3, 5:3:3, and 5:4:3) are all strictly backwards compatible: it is guaranteed that any newer DLL in the series can be loaded by an exe that was compiled against an older DLL in the series.
In 1.2.3, the DLLVER was 12. Let's pretend that was a 'c' - 'a' of 12, and that 'c' = 12 and 'a' = 0.
In [libpng] 1.2.4, you simply added some new functions — but did NOT remove any. So, the new libtool number is 13:0:1 — and DLLVER remains 12.
An editorial note about how this impacts on the makefile.cygwin in libpng (1.2.4 and higher), I'll mention that the makefile macro PNGDLL was changed to CYGDLL . Confusion over the reasons for the Cygwin library versioning style were the occasion for the posting by Chuck Wilson of the above message, and it was thought that "de-coupling" the versioning scheme of the MSVC build from that of Cygwin builds would be a good idea, since it appears that the two schemes are not the same.