Hi Everyone,

We added two new functions to the library. They are HeaderVersion and 
LibraryVersion. HeaderVersion is CRYPTOPP_VERSION from cryptlib.h, and its 
an inline function that always reports the version as recorded in the 
header. LibraryVersion is also CRYPTOPP_VERSION, but its recorded in the 
static archive or dynamic library at library compile time. It does not 
change if the wrong headers are used.

The functions dropped out of another project's bug report where they 
believed they were using a particular version of the library, but 
headers/libraries were being mixed and matched. In an ideal world, build 
systems and users always pick the right version of the library. Inthe real 
world things sometimes go astray.

The functions use C linkage, so they can be located without name mangling. 
If you dlopen/dlsym the library and the symbol is not present, then you are 
using 5.6.5 or below. If the symbol is present, then its 5.7 or above.

The downside is they are 10-based, so you have to do things like 
(HeaderVersion() / 10) % 10 to get the minor version number. The workaround 
was to add additional symbols, and I kind of wanted to avoid it.

They were committed at 
https://github.com/weidai11/cryptopp/commit/6f7339c81b26985a830da6efe1da59e3897f6b71
 
and 
https://github.com/weidai11/cryptopp/commit/42af35fd2bcf00e983772dbb6e409f8ba5f49fc6.

Jeff

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to