Next: , Previous: , Up: Preparation   [Contents][Index]


6.2.3 Version check

It is often desirable to check that the version of ‘gnutls’ used is indeed one which fits all requirements. Even with binary compatibility new features may have been introduced but due to problem with the dynamic linker an old version is actually used. So you may want to check that the version is okay right after program start-up. See the function gnutls_check_version.

On the other hand, it is often desirable to support more than one versions of the library. In that case you could utilize compile-time feature checks using the GNUTLS_VERSION_NUMBER macro. For example, to conditionally add code for GnuTLS 3.2.1 or later, you may use:

#if GNUTLS_VERSION_NUMBER >= 0x030201
 ...
#endif