cmGlobal.h : Added cmXXXBits() in-place binary operations.

This commit is contained in:
kevin.larke 2020-02-21 12:35:18 -05:00
parent 575db4382d
commit e9afa60e75

View File

@ -91,6 +91,12 @@ extern "C" {
//<
//< If 'b' == 0 then return 'f' with the bits in 'm' cleared.
//< otherwise return 'f' with the bits in 'm' set.
// In-place assignment version of the above bit operations
#define cmSetBits(f,m) ((f) |= (m)) // Set 'f' with the bits in 'm' set.
#define cmClrBits(f,m) ((f) &= (~(m))) // Set 'f' with the bits in 'm' cleared.
#define cmTogBits(f,m) ((f)^=(m)) // Return 'f' with the bits in 'm' toggled.
#define cmEnaBits(f,m,b) ((b) ? cmSetBits(f,m) : cmClrBits(f,m)) // Set or clear bits in 'f' based on bits in 'm' and the state of 'b'.
#define cmMin(v0,v1) ((v0)<(v1) ? (v0) : (v1)) //< Return the minimum arg.