Quick Links:

bal | bbl | bdl | bsl

Component bslscm_versiontag
[Package bslscm]

Provide versioning information for the bsl package group. More...

Outline
Purpose:
Provide versioning information for the bsl package group.
Classes:
Macros:
BSL_VERSION_MAJOR current release major version number
BSL_VERSION_MINOR current release minor version number
BSL_MAKE_VERSION(MA, MI) create a combined version number
BSL_VERSION combined version number for current release
BSL_GET_VERSION_MAJOR(vers) extract from vers the major version
BSL_GET_VERSION_MINOR(vers) extract from vers the minor version
See also:
Component bslscm_version
Description:
This component provides versioning information for the bsl package group. The BSL_VERSION and BSL_MAKE_VERSION macros that are supplied can be used for conditional-compilation based on bsl version information.
Note that the exact format of the values BSL_MAKE_VERSION outputs is deliberately unspecified - it is subject to change without notice. The only valid operations on the output of BSL_MAKE_VERSION are comparing it with the result of other BSL_MAKE_VERSION invocations, or using BSL_GET_VERSION_MAJOR or BSL_GET_VERSION_MINOR to extract the major/minor components respectively.
The following usage example illustrates this basic capability.
Usage:
At compile time, the version of BSL can be used to select an older or newer way to accomplish a task, to enable new functionality, or to accommodate an interface change. For example, if the name of a function changes (a rare occurrence, but potentially disruptive when it does happen), the impact on affected code can be minimized by conditionally calling the function by its old or new name using conditional compilation. In the following, the #if preprocessor directive compares BSL_VERSION (i.e., the latest BSL version, excluding the patch version) to a specified major and minor version composed using the BSL_MAKE_VERSION macro:
  #if BSL_VERSION > BSL_MAKE_VERSION(1, 3)
      // Call 'newFunction' for BSL versions later than 1.3.
      int result = newFunction();
  #else
      // Call 'oldFunction' for BSL version 1.3 or earlier.
      int result = oldFunction();
  #endif