BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balscm_versiontag

Macros

#define BAL_VERSION_MAJOR   4
 BAL release major version.
 
#define BAL_VERSION_MINOR   14
 BAL release major version.
 
#define BAL_VERSION
 
#define BAL_VERSION_DEPRECATION_THRESHOLD   BSLS_DEPRECATE_MAKE_VER(3, 1)
 

Detailed Description

Outline

Purpose

Provide versioning information for the bal package group.

See also
balscm_version

Description

This component provides versioning information for the bal package group. The BAL_VERSION macro that is supplied can be used for conditional-compilation based on bal version information. The following usage example illustrates this basic capability.

Note that since bal is always released in lock-step with bsl, they share common versioning, and the BAL_VERSION will always equal the BSL_VERSION.

Usage

This section illustrates intended use of this component.

Example 1: Basic Usage

At compile time, the version of BAL 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 BAL_VERSION (i.e., the latest BAL version, excluding the patch version) to a specified major and minor version composed using the BSL_MAKE_VERSION macro:

#if BAL_VERSION > BSL_MAKE_VERSION(1, 3)
// Call 'newFunction' for BAL versions later than 1.3.
int result = newFunction();
#else
// Call 'oldFunction' for BAL version 1.3 or earlier.
int result = oldFunction();
#endif

Macro Definition Documentation

◆ BAL_VERSION

#define BAL_VERSION
Value:
#define BAL_VERSION_MINOR
BAL release major version.
Definition balscm_versiontag.h:90
#define BAL_VERSION_MAJOR
BAL release major version.
Definition balscm_versiontag.h:87
#define BSL_MAKE_VERSION(major, minor)
Definition bslscm_versiontag.h:119

Construct an integer (unique to the specified BAL_VERSION_MAJOR and BAL_VERSION_MINOR numbers) corresponding to the major and minor version numbers, respectively, of the current (latest) BAL release. Note that the patch version number is intentionally not included. The exact format of the result is an implementation detail of bslscm_versiontag . The major and minor parts of the resulting version can be extracted with BSL_GET_VERSION_MAJOR and BSL_GET_VERSION_MINOR respectively.

◆ BAL_VERSION_DEPRECATION_THRESHOLD

#define BAL_VERSION_DEPRECATION_THRESHOLD   BSLS_DEPRECATE_MAKE_VER(3, 1)

Declare that deprecations for this UOR introduced in the specified version or earlier will be "active" by default – i.e., BSLS_DEPRECATE_IS_ACTIVE will be true (which typically enables deprecation warnings). Note that we define this macro in the version component, so that it is available at the lowest level in the component hierarchy of this UOR.

◆ BAL_VERSION_MAJOR

#define BAL_VERSION_MAJOR   4

◆ BAL_VERSION_MINOR

#define BAL_VERSION_MINOR   14