Group api_macros
Macros
| Type | Name |
|---|---|
| define | LIBMDBX_INLINE_API (TYPE, NAME, ARGS) static \_\_inline TYPE NAME ARGSAuxiliary macro for robustly define the both inline version of API function and non-inline fallback dll-exported version for applications linked with old version of libmdbx, with a strictly ODR-common implementation. Thus, we emulate __extern_inline for all compilers, including non-GNU ones. |
| define | MDBX_CONST_FUNCTION [[gnu::const]]The const function attribute for optimization. |
| define | MDBX_CXX01_CONSTEXPR constexpr |
| define | MDBX_CXX01_CONSTEXPR_VAR constexpr |
| define | MDBX_CXX11_CONSTEXPR constexpr |
| define | MDBX_CXX11_CONSTEXPR_VAR constexpr |
| define | MDBX_CXX14_CONSTEXPR constexpr |
| define | MDBX_CXX14_CONSTEXPR_VAR constexpr |
| define | MDBX_CXX17_NOEXCEPT noexcept |
| define | MDBX_INLINE_API_ASSERT (expr) /* multi line expression */ |
| define | MDBX_LIKELY (cond) \_\_builtin\_expect(!!(cond), 1) |
| define | MDBX_MAYBE_UNUSED [[maybe\_unused]] |
| define | MDBX_NORETURN [[noreturn]] |
| define | MDBX_NOTHROW_CONST_FUNCTION [[gnu::const, gnu::nothrow]]The const nothrow function attribute for optimization. |
| define | MDBX_NOTHROW_PURE_FUNCTION [[gnu::pure, gnu::nothrow]]The pure nothrow function attribute for optimization. |
| define | MDBX_PURE_FUNCTION [[gnu::pure]]The pure function attribute for optimization. |
| define | MDBX_UNLIKELY (cond) \_\_builtin\_expect(!!(cond), 0) |
| define | __has_C23_or_CXX_attribute (x) [**\_\_has\_c\_attribute\_qualified**](group__api__macros.md#define-__has_c_attribute_qualified)(x) |
| define | __has_c_attribute (x) (0) |
| define | __has_c_attribute_qualified (x) 0 |
| define | __has_cpp_attribute_qualified (x) 0 |
| define | __has_exceptions_disabled (0) |
Macro Definition Documentation
define LIBMDBX_INLINE_API
Auxiliary macro for robustly define the both inline version of API function and non-inline fallback dll-exported version for applications linked with old version of libmdbx, with a strictly ODR-common implementation. Thus, we emulate __extern_inline for all compilers, including non-GNU ones.
#define LIBMDBX_INLINE_API (
TYPE,
NAME,
ARGS
) `static __inline TYPE NAME ARGS`
define MDBX_CONST_FUNCTION
The const function attribute for optimization.
#define MDBX_CONST_FUNCTION `[[gnu::const]]`
Many functions do not examine any values except their arguments, and have no effects except the return value. Basically this is just slightly more strict class than the PURE attribute, since function is not allowed to read global memory.
Note that a function that has pointer arguments and examines the data pointed to must not be declared const. Likewise, a function that calls a non-const function usually must not be const. It does not make sense for a const function to return void.
define MDBX_CXX01_CONSTEXPR
#define MDBX_CXX01_CONSTEXPR `constexpr`
Workaround for old compilers without support for any kind of constexpr.
define MDBX_CXX01_CONSTEXPR_VAR
#define MDBX_CXX01_CONSTEXPR_VAR `constexpr`
define MDBX_CXX11_CONSTEXPR
#define MDBX_CXX11_CONSTEXPR `constexpr`
Workaround for old compilers without properly support for C++11 constexpr.
define MDBX_CXX11_CONSTEXPR_VAR
#define MDBX_CXX11_CONSTEXPR_VAR `constexpr`
define MDBX_CXX14_CONSTEXPR
#define MDBX_CXX14_CONSTEXPR `constexpr`
Workaround for old compilers without properly support for C++14 constexpr.
define MDBX_CXX14_CONSTEXPR_VAR
#define MDBX_CXX14_CONSTEXPR_VAR `constexpr`
define MDBX_CXX17_NOEXCEPT
#define MDBX_CXX17_NOEXCEPT `noexcept`
Workaround for old compilers without support for C++17 noexcept.
define MDBX_INLINE_API_ASSERT
#define MDBX_INLINE_API_ASSERT (
expr
) `/* multi line expression */`
define MDBX_LIKELY
#define MDBX_LIKELY (
cond
) `__builtin_expect(!!(cond), 1)`
define MDBX_MAYBE_UNUSED
#define MDBX_MAYBE_UNUSED `[[maybe_unused]]`
define MDBX_NORETURN
#define MDBX_NORETURN `[[noreturn]]`
define MDBX_NOTHROW_CONST_FUNCTION
The const nothrow function attribute for optimization.
#define MDBX_NOTHROW_CONST_FUNCTION `[[gnu::const, gnu::nothrow]]`
Like MDBX_CONST_FUNCTION with addition noexcept restriction that is compatible to CLANG and future [[const]].
define MDBX_NOTHROW_PURE_FUNCTION
The pure nothrow function attribute for optimization.
#define MDBX_NOTHROW_PURE_FUNCTION `[[gnu::pure, gnu::nothrow]]`
Like MDBX_PURE_FUNCTION with addition noexcept restriction that is compatible to CLANG and proposed [[pure]].
define MDBX_PURE_FUNCTION
The pure function attribute for optimization.
#define MDBX_PURE_FUNCTION `[[gnu::pure]]`
Many functions have no effects except the return value and their return value depends only on the parameters and/or global variables. Such a function can be subject to common subexpression elimination and loop optimization just as an arithmetic operator would be. These functions should be declared with the attribute pure.
define MDBX_UNLIKELY
#define MDBX_UNLIKELY (
cond
) `__builtin_expect(!!(cond), 0)`
define __has_C23_or_CXX_attribute
#define __has_C23_or_CXX_attribute (
x
) `__has_c_attribute_qualified (x)`
define __has_c_attribute
#define __has_c_attribute (
x
) `(0)`
define __has_c_attribute_qualified
#define __has_c_attribute_qualified (
x
) `0`
define __has_cpp_attribute_qualified
#define __has_cpp_attribute_qualified (
x
) `0`
define __has_exceptions_disabled
#define __has_exceptions_disabled `(0)`