Macros
ADD_PRIMITIVE_HANDLER: Macro to add other [almost identical] variants of the add() and operator+=() functions.
CARBONITE_MAJOR: Defines the current major version of the Carbonite framework.
CARBONITE_MINOR: Defines the current minor version of the Carbonite framework.
CARB_AARCH64: A macro defined as
1
if compilation is targeting the AArch64 platform;0
otherwise. May not be overridden on the command line or by defining before including this file. Set to1
if__aarch64__
is defined,0
if__x86_64__
or_M_X64
are defined, and left undefined otherwise.CARB_ABI: Defined as
__cdecl
on Windows and an empty define on Linux. Used to explicitly state ABI calling convention for API functions.CARB_ALIGN: Aligns a number or pointer to the next multiple of a provided alignment.
CARB_ALIGNED_SIZE: Aligns a size to the given alignment.
CARB_ALIGN_AS: Defined as
alignas(T)
.CARB_ALIGN_OF: Returns the required alignment of a type.
CARB_ALLOCA: This is a wrapper for the platform-specific call to the non-standard but almost universal alloca() function.
CARB_ALWAYS_INLINE: Instructs the compiler to force inline of the decorated function.
CARB_ANONYMOUS_VAR: A helper macro that appends a number to the given name to create a unique name.
CARB_ARCH_NAME: The name of the current architecture as a string.
CARB_ASAN_ENABLED: A macro defined as
1
if the toolchain is building the current file with-fsanitize=address
, that is, if__SANITIZE_ADDRESS__
is defined;0
otherwise. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line. Microsoft Visual Studio supports address sanitizer starting with 2019 (v16.9) by specifying/fsanitize=address
on the compiler command line. See https://learn.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-160 .CARB_ASSERT: Optionally performs an assertion, by default for debug builds only.
CARB_ASSERT_ASYNC: A macro that is used to assert that a scope is running in task context in debug builds only.
CARB_ASSERT_ENABLED: Indicates whether asserts are enabled. May be overridden by defining this before including this file. By default, is set to
1
ifCARB_DEBUG
is non-zero. If this is overridden to a non-zero value andCARB_ASSERT
is not defined,CARB_ASSERT
will receive the default implementation.CARB_ASSERT_GLOBALS: Placeholder macro for any work that needs to be done at the global level for any IAssert related functionality.
CARB_ASSERT_INTEROP_SAFE: A macro to ensure interop safety by assertion.
CARB_ASSERT_MEMBERS_MATCH: A helper to determine if member
A.a
matches the offset and size ofB.b
, causing a static assert if unmatched.CARB_ASSERT_STRUCTS_MATCH: A helper to determine if the size and alignment of two given structures match, causing a static assert if unmatched.
CARB_ASSET: Registers an asset type.
CARB_ASYNC: A macro that can be used to mark a function as async, that is, it always executes in the context of a task.
CARB_ATTRIBUTE: GCC only, defined as
__attribute__((__VA_ARGS__))
; ignored on non-GCC compilers.CARB_BINDINGS: Declare a compilation unit as script language bindings.
CARB_BINDINGS_EX: Declare a compilation unit as script language bindings.
CARB_BREAK_POINT: On Windows platforms, defined as
__debugbreak()
; on Linux,raise(SIGTRAP)
. Used to break into the debugger.CARB_CACHELINE_ALIGN: Defined as
CARB_ALIGN_AS(CARB_CACHELINE_SIZE)
.CARB_CACHELINE_SIZE: Minimum offset between two objects to avoid false sharing, i.e. cache line size. If C++17 is not supported, falls back to the default value of 64 bytes.
CARB_CHECK: Optionally performs a runtime check assertion, by default for both debug and release builds.
CARB_CHECK_ASYNC: A macro that is used to assert that a scope is running in task context in debug and checked builds.
CARB_CHECK_ENABLED: Indicates whether runtime checking is enabled. May be overridden by defining this before including this file. By default, is set to
1
always. If this is overridden to a non-zero value andCARB_CHECK
is not defined,CARB_CHECK
will receive the default implementation.CARB_CLAMP: A macro the returns the largest of two values.
CARB_COMPILER_GNUC: A macro defined as
1
if compilation is using GNU C Compiler (GCC), that is, if_MSC_VER
is not defined but__GNUC__
is defined. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line, however, only one ofCARB_COMPILER_MSC
andCARB_COMPILER_GNUC
must be set to1
; the other macro(s) must be set to0
.CARB_COMPILER_MSC: A macro defined as
1
if compilation is using Microsoft Visual C++, that is, if_MSC_VER
is defined. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line, however, only one ofCARB_COMPILER_MSC
andCARB_COMPILER_GNUC
must be set to1
; the other macro(s) must be set to0
.CARB_COUNTOF: Returns the count of an array as a
size_t
at compile time.CARB_COUNTOF32: Returns the count of an array as a
uint32_t
at compile time.CARB_CPP17_CONSTEXPR: Defined as
constexpr
if the current compiler supports C++17; empty otherwise.CARB_CPP20_CONSTEXPR: Defined as
constexpr
if the current compiler supports C++20; empty otherwise.CARB_CPP20_LIKELY: Defined as
[[likely]]
if the current compiler supports C++20 (that is, CARB_HAS_CPP20 is non-zero) and the compiler reports the presence of thelikely
attributes.CARB_CPP20_UNLIKELY: Defined as
[[unlikely]]
if the current compiler supports C++20 (that is, CARB_HAS_CPP20 is non-zero) and the compiler reports the presence of theunlikely
attributes.CARB_CRASH_REPORTER_GLOBALS: Defines global symbols specifically related to the crash reporter.
CARB_DEBUG: A macro indicating whether the current compilation unit is built in debug mode. Always defined as either 0 or 1. Can be overridden by defining before this file is included or by passing on the compiler command line. Defined as
0
ifNDEBUG
is defined;1
otherwise.CARB_DECLSPEC: MSVC only, defined as
__declspec(__VA_ARGS__)
; ignored on non-MSVC compilers.CARB_DEFAULT_INITIALIZERS: Plugin helper macro to define boiler-plate code to register and unregister the plugin with various other components in the system (e.g. logging channels, profiler, localization, etc.).
CARB_DEPAREN: De-parenthesize the contents of
pack_
.CARB_DEPAREN((x, y))
becomesx, y
. An unparenthesized pack will cause cause a compilation failure; e.g.:CARB_DEPAREN(foo)
will not work, butCARB_DEPAREN((foo))
will.CARB_DEPRECATED: Declares a function as deprecated.
CARB_DETAIL_DEFINE_DEFERRED_LOAD: Create a "deferred loader" function.
CARB_DIVIDE_CEIL: Divides size by divisor and returns the closest integer greater than or equal to the division result.
CARB_DOC_CONSTEXPR: Macro to work around Exhale tripping over
constexpr
sometimes and reporting things like:Invalid C++ declaration: Expected identifier in nested name, got keyword: static
CARB_DOC_ONLY: Conditionally includes text only when documenting (i.e. when
DOXYGEN_BUILD
is defined).CARB_DYNAMICLINK: Conditional (import/export) dynamic linking.
CARB_EVENTS_TYPE_FROM_STR: Compile-time conversion of string to carb::events::EventType .
CARB_EXCEPTIONS_ENABLED: Indicates whether exceptions are enabled for the current compilation unit. Value depends on parameters passed to the compiler.
CARB_EXECUTABLE_EXTENSION: The default executable file extension for the current platform.
CARB_EXPORT: Grants a function external linkage in a dynamic library or executable.
CARB_EXPORTS: Instructs CARB_DYNAMICLINK to export instead of import.
CARB_EXTERN_C: Defined as
extern "C"
for C++ compilation, that is, when__cplusplus
is defined; empty define otherwise.CARB_FAKE_PRINTF: A printf that will never be executed but allows the compiler to test if there are format errors.
CARB_FALLTHROUGH: Defined as
[[fallthrough]]
if the current compiler supports C++17; empty otherwise.CARB_FATAL_UNLESS: Terminates the application if a check fails.
CARB_FATAL_UNLESS_ASYNC: A macro that is used to assert that a scope is running in task context.
CARB_FILE_DEPRECATED: Declares a file as deprecated.
CARB_FLOAT_MAX: The maximum value that can be represented by
float
.CARB_FORMATTED: Formats a string as if by vsnprintf and invokes a callable with the result.
CARB_FORMATTED_N: Formats a string as if by vsnprintf and invokes a callable with the result and the length.
CARB_FORMATTED_N_SIZE: Formats a string as if by vsnprintf and invokes a callable with the result and the length.
CARB_FORMATTED_SIZE: Formats a string as if by vsnprintf and invokes a callable with the result.
CARB_FRAMEWORK_GLOBALS: Defines global variables for use by Carbonite. Call this macro from the global namespace.
CARB_FREE: Frees memory previously allocated using CARB_MALLOC() .
CARB_GLOBALS: Defines global variables of the framework and built-in plugins.
CARB_GLOBALS_EX: Defines global variables of the framework and built-in plugins.
CARB_GNUC_ONLY: GCC only, defined as
gnuc_only_block
; ignored on non-GCC compilers.CARB_HARDWARE_PAUSE: Instructs the underlying hardware to idle the CPU pipelines and reduce the penalty from memory order violations.
CARB_HASH_STRING: Computes a literal string hash at compile time.
CARB_HASH_TYPE: Syntactic sugar for
CARB_HASH_STRING(CARB_STRINGIFY(T))
.CARB_HAS_CPP14: Defined as
1
if the current compiler supports C++14;0
otherwise. C++14 is the minimum required for using Carbonite (though building Carbonite requires C++17).CARB_HAS_CPP17: Defined as
1
if the current compiler supports C++17;0
otherwise.CARB_HAS_CPP20: Defined as
1
if the current compiler supports C++20;0
otherwise.CARB_HEXVERSION: A macro to construct a hex-version.
CARB_HIDDEN: Syntactic sugar for
CARB_ATTRIBUTE(visibility("hidden"))
; ignored on compilers other than GCC.CARB_IDENTITY: Return exactly the arguments. This is useful for expansion of the tokens.
CARB_IF_NOT_TSAN: Macro declaring code that should be instantiated if TSan is NOT enabled.
CARB_IF_TSAN: Macro declaring code that should be instantiated if TSan is enabled.
CARB_IGNOREWARNING_CLANG: For Clang only, disables a specific compiler warning for the current compilation warning configuration. Defined as
_Pragma("GCC diagnostic ignored <warning>")
for Clang only; ignored by other compilers.CARB_IGNOREWARNING_CLANG_POP: For Clang only, pops the compilation warning configuration previously pushed with CARB_IGNOREWARNING_CLANG_PUSH , overwriting the current state. Defined as
_Pragma("GCC diagnostic pop")
for Clang only; ignored by other compilers.CARB_IGNOREWARNING_CLANG_PUSH: For Clang only, pushes the current compilation warning configuration. Defined as
_Pragma("GCC diagnostic push")
for Clang only; ignored by other compilers.CARB_IGNOREWARNING_CLANG_WITH_PUSH: Syntactic sugar for CARB_IGNOREWARNING_CLANG_PUSH followed by CARB_IGNOREWARNING_CLANG .
CARB_IGNOREWARNING_GNUC: For GCC only, disables a specific compiler warning for the current compilation warning configuration. Defined as
_Pragma("GCC diagnostic ignored <warning>")
for GCC only; ignored by other compilers.CARB_IGNOREWARNING_GNUC_POP: For GCC only, pops the compilation warning configuration previously pushed with CARB_IGNOREWARNING_GNUC_PUSH , overwriting the current state. Defined as
_Pragma("GCC diagnostic pop")
for GCC only; ignored by other compilers.CARB_IGNOREWARNING_GNUC_PUSH: For GCC only, pushes the current compilation warning configuration. Defined as
_Pragma("GCC diagnostic push")
for GCC only; ignored by other compilers.CARB_IGNOREWARNING_GNUC_WITH_PUSH: Syntactic sugar for CARB_IGNOREWARNING_GNUC_PUSH followed by CARB_IGNOREWARNING_GNUC .
CARB_IGNOREWARNING_MSC: For MSVC only, disables a specific compiler warning for the current compilation warning configuration. Defined as
__pragma(warning(disable : <w>))
for MSVC only; ignored by other compilers.CARB_IGNOREWARNING_MSC_POP: For MSVC only, pops the compilation warning configuration previously pushed with CARB_IGNOREWARNING_MSC_PUSH , overwriting the current state. Defined as
__pragma(warning(pop))
for MSVC only; ignored by other compilers.CARB_IGNOREWARNING_MSC_PUSH: For MSVC only, pushes the current compilation warning configuration. Defined as
__pragma(warning(push))
for MSVC only; ignored by other compilers.CARB_IGNOREWARNING_MSC_WITH_PUSH: Syntactic sugar for CARB_IGNOREWARNING_MSC_PUSH followed by CARB_IGNOREWARNING_MSC .
CARB_IMPORT: Imports a function with external linkage from a shared object or DLL.
CARB_INCLUDE_PURIFY_TEST: A macro that is used only for public includes to define a function which will instantiate templates.
CARB_IOBJECT_IMPL: Helper macro to implement default behavior of carb::IObject interface functions IObject::addRef() and IObject::release().
CARB_IS_ASYNC: Helper macro that results in a boolean expression which is
true
if the current thread is running in task context.CARB_IS_SAME_SDK_VERSION: Tests whether the Carbonite SDK headers match the version of used to build the framework.
CARB_JOIN: A macro that joins two parts to create one symbol allowing one or more parameters to be a macro, as if by the
##
preprocessor operator. Example:CARB_JOIN(test, __LINE__)
on line 579 producestest579
.CARB_LIBRARY_EXTENSION: The default library file extension for the current platform.
CARB_LIBRARY_GET_LITERAL_NAME: A macro to build a library file's name as a string literal.
CARB_LIBRARY_PREFIX: Retrieves the default library file prefix for the current platform.
CARB_LIKELY: If the current compiler is GCC, defined as
__builtin_expect(!!(<expr>), 1)
. Otherwise, defined as(!!(<expr>))
.CARB_LIKELY_IF: A helper for using both the CARB_LIKELY macro as well as the CARB_CPP20_LIKELY macro.
CARB_LOCALIZATION_GLOBALS: Placeholder for global scope work that needs to be done for localization.
CARB_LOCALIZE: Look up a string from the localization database for the current plugin.
CARB_LOG: Logging macro if the level is dynamic.
CARB_LOG_ERROR: Logging macro for static log level.
CARB_LOG_ERROR_ONCE: Single-time logging macro for static log level.
CARB_LOG_FATAL: Logging macro for static log level.
CARB_LOG_FATAL_ONCE: Single-time logging macro for static log level.
CARB_LOG_GLOBALS: Placeholder macro for any globals that must be declared for the logging system.
CARB_LOG_INFO: Logging macro for static log level.
CARB_LOG_INFO_ONCE: Single-time logging macro for static log level.
CARB_LOG_ONCE: Single-time logging macro if the level is dynamic.
CARB_LOG_VERBOSE: Logging macro for static log level.
CARB_LOG_VERBOSE_ONCE: Single-time logging macro for static log level.
CARB_LOG_WARN: Logging macro for static log level.
CARB_LOG_WARN_ONCE: Single-time logging macro for static log level.
CARB_MACOS_UNIMPLEMENTED: A macro to mark placeholder functions on MacOS while the porting effort is in progress.
CARB_MAKE_FOURCC: A macro for producing a carb::FourCC value from four characters.
CARB_MALLOC: Allocates memory from the heap.
CARB_MAX: A macro the returns the largest of two values.
CARB_MAYBE_ASYNC: A macro that can be used to mark a function as possibly async, that is, it may execute in the context of a task.
CARB_MAYBE_UNUSED: Defined as
[[maybe_unused]]
if the current compiler supports C++17; empty otherwise.CARB_MIN: A macro that returns the least of two values.
CARB_MSC_ONLY: MSVC only, defined as
__VA_ARGS__
; ignored on non-MSVC compilers.CARB_NAME_THREAD: Records the name of a thread.
CARB_NODISCARD: Defined as
[[nodiscard]]
if the current compiler supports C++17. This reverts towarn_unused_result
attribute where it is available and will be empty if it is not.CARB_NODISCARD_TYPE: Defined as
[[nodiscard]]
if the current compiler supports C++17 and is empty otherwise. This operates similar toCARB_NODISCARD
but is meant to be used on type definitions, as thewarn_unused_result
fallback is not supported for types.CARB_NOEXCEPT: Declares that a function will not throw any exceptions.
CARB_NOINLINE: A macro that declares that a function may not be inlined.
CARB_NOT_GNUC: Only non-GCC compilers, defined as
__VA_ARGS__
; ignored on GCC.CARB_NOT_MSC: Only non-MSVC compilers, defined as
__VA_ARGS__
; ignored on MSVC.CARB_NO_DOC: Declares a value or statement in a way that prevents Doxygen and Sphinx from getting confused about matching symbols. There seems to be a bug in Sphinx that prevents at least templated symbols from being matched to the ones generated by Doxygen when keywords such as
decltype
are used. This is effectively the opposite operation as CARB_DOC_ONLY() .CARB_NO_OPTIMIZE_GNUC_CLANG: Disables optimizations for the function that is tagged with this attribute. This only affects the single function that it tags. Optimizations will be restored to the previous settings for the translation unit outside of the tagged function.
CARB_NO_UNIQUE_ADDRESS: Defined as
[[no_unique_address]]
if the current compiler supports C++20; empty otherwise.CARB_OFFSETOF: Returns the offset of a member of a class at compile time.
CARB_OPTIMIZE_OFF_MSC: Turns optimizations off at the function level until a CARB_OPTIMIZE_ON_MSC() call is seen. This must be called outside of the body of any function and will remain in effect until either a CARB_OPTIMIZE_ON_MSC() call is seen or the end of the translation unit. This unfortunately needs to be a separate set of macros versus the one for GCC and Clang due to the different style of disabling and enabling optimizations under the MSC compiler.
CARB_OPTIMIZE_ON_MSC: Restores previous optimizations that were temporarily disable due to an earlier call to CARB_OPTIMIZE_OFF_MSC() . This must be called outside the body of any function. If this call is not made, the previous optimization state will remain until the end of the current translation unit.
CARB_PLATFORM_LINUX: A macro defined as
1
if compilation is targeting Linux;0
otherwise. Exactly one of theCARB_PLATFORM_*
macros will be set to1
. May be overridden by defining before this file is included or by passing on the compiler command line. By default, set to1
if_WIN32
is not defined and__linux__
is defined.CARB_PLATFORM_MACOS: A macro defined as
1
if compilation is targeting Mac OS;0
otherwise. Exactly one of theCARB_PLATFORM_*
macros will be set to1
. May be overridden by defining before this file is included or by passing on the compiler command line. By default, set to1
if_WIN32
and__linux__
are not defined and__APPLE__
is defined.CARB_PLATFORM_NAME: The name of the current platform as a string.
CARB_PLATFORM_WINDOWS: A macro defined as
1
if compilation is targeting Windows;0
otherwise. Exactly one of theCARB_PLATFORM_*
macros will be set to1
. May be overridden by defining before this file is included or by passing on the compiler command line. By default, set to1
if_WIN32
is defined.CARB_PLUGIN_IMPL: Main macro to declare a plugin implementation where multiple interface versions are not required.
CARB_PLUGIN_IMPL_DEPS: Macros to declare a plugin implementation dependencies.
CARB_PLUGIN_IMPL_EX: Main macro to declare a plugin implementation where multiple interface versions are required.
CARB_PLUGIN_IMPL_MINIMAL: Macro to declare a "minimal" plugin.
CARB_PLUGIN_IMPL_NO_DEPS: Macro to declare a plugin without dependencies.
CARB_PLUGIN_INTERFACE: Macro to declare a
struct
as a Carbonite interface.CARB_PLUGIN_INTERFACE_EX: Macro to declare a
struct
as a Carbonite interface that allows for a different current version than latest.CARB_POSIX: This is set to
_POSIX_VERSION
platforms that are mostly-compliant with POSIX.CARB_PRAGMA: Generic pragma, only to be used for pragmas that are the same on all supported compilers.
CARB_PRAGMA_GNUC: GCC only, defined as
_Pragma(__VA_ARGS__)
; ignored on non-GCC compilers.CARB_PRAGMA_MSC: MSVC only, defined as
__pragma(__VA_ARGS__)
; ignored on non-MSVC compilers.CARB_PREFETCH: Attempts to prefetch from memory using a compiler intrinsic.
CARB_PRETTY_FUNCTION: Acts as a
char[]
with the current full function signature.CARB_PREVENT_COPY: A macro that deletes the copy-construct and copy-assign functions for the given classname.
CARB_PREVENT_COPY_AND_MOVE: Syntactic sugar for both CARB_PREVENT_COPY and CARB_PREVENT_MOVE .
CARB_PREVENT_MOVE: A macro that deletes the move-construct and move-assign functions for the given classname.
CARB_PRINTF_FUNCTION: Requests that the compiler validate any variadic arguments as printf-style format specifiers, if supported by the compiler. Causes a compilation error if the printf-style format specifier doesn't match the given variadic types.
CARB_PROFILER_GLOBALS: Placeholder macro for any work that needs to be done at the global scope for the profiler.
CARB_PROFILE_ALLOC: Records an allocation event for profilers that support them.
CARB_PROFILE_ALLOC_NAMED: Records an allocation event for a named memory pool for profilers that support them.
CARB_PROFILE_BEGIN: Marks the beginning of a profiling zone.
CARB_PROFILE_CALIBRATE_GPU_CONTEXT: Submit context calibration information that allows correlating CPU and GPU clocks.
CARB_PROFILE_CREATE_GPU_CONTEXT: Create a new GPU profiling context that allows injecting timestamps coming from a GPU in a deferred manner.
CARB_PROFILE_DECLARE_CHANNEL: Declares a channel that can be used with the profiler.
CARB_PROFILE_DESTROY_GPU_CONTEXT: Destroy a previously created GPU Context.
CARB_PROFILE_END: Marks the end of a profiling zone previously started with CARB_PROFILE_BEGIN() .
CARB_PROFILE_EVENT: Records an instant event on a thread's timeline at the current time.
CARB_PROFILE_EXTERN_CHANNEL: References a channel declared in another compilation unit.
CARB_PROFILE_FLOW_BEGIN: Records the beginning of a flow event on the timeline at the current time for the current thread.
CARB_PROFILE_FLOW_END: Records the end of a flow event on the timeline at the current time for the current thread.
CARB_PROFILE_FRAME: Inserts a frame marker for the calling thread in the profiling output, for profilers that support frame markers.
CARB_PROFILE_FREE: Records a free event for profilers that support them.
CARB_PROFILE_FREE_NAMED: Records a free event for a named memory pool for profilers that support them.
CARB_PROFILE_FUNCTION: A helper for CARB_PROFILE_ZONE() that automatically uses the function name as from
CARB_PRETTY_FUNCTION
.CARB_PROFILE_GPU_QUERY_BEGIN: Record the beginning of a new GPU timestamp query.
CARB_PROFILE_GPU_QUERY_END: Record the end of a new GPU timestamp query.
CARB_PROFILE_GPU_SET_QUERY_VALUE: Set the value we've received from the GPU for a query (begin or end) we've issued in the past.
CARB_PROFILE_LOCKABLE_CREATE: Create a lockable context which we can use to tag lock operation.
CARB_PROFILE_LOCKABLE_DESTROY: Destroy a lockable context.
CARB_PROFILE_LOCKABLE_OPERATION: Records a lockable operation on a thread's timeline at the current time.
CARB_PROFILE_REGISTER_STRING: Registers a static string for use with the profiler.
CARB_PROFILE_SET_CAPTURE_MASK: A helper to set the capture mask.
CARB_PROFILE_SHUTDOWN: Shuts down the profiler that has been registered with carb::profiler::registerProfilerForClient() and previously started with CARB_PROFILE_STARTUP() .
CARB_PROFILE_STARTUP: Starts the profiler that has been registered with carb::profiler::registerProfilerForClient() .
CARB_PROFILE_VALUE: Writes a named numeric value to the profiling output for profilers that support them.
CARB_PROFILE_ZONE: Creates a profiling zone over a scope.
CARB_PROFILING: When set to a non-zero value, profiling macros in include/carb/profiler/Profile.h will report to the profiler; otherwise the profiling macros have no effect. Always set to
1
by default, but may be overridden by defining a different value before including this file or by specifying a different value on the compiler command line.CARB_REQUIRE_LINKED: Changes how the
carbReallocate
symbol is acquired.CARB_RESULT_USE_OMNI_RESULT_GEN: Undocumented.
CARB_RETRY_EINTR: A macro to retry operations if they return -1 and errno is set to EINTR.
CARB_ROUNDUP: Rounds a given value to the next highest multiple of another given value.
CARB_SDK_VERSION: Version string for this SDK build. This string is also returned by carbGetSdkVersion(). This value can be passed to CARB_IS_SAME_SDK_VERSION() to verify that the loaded version of the Carbonite framework library matches the headers that are in use.
CARB_STACK_ALLOC: Attempts to allocate an array of the given type on the stack.
CARB_STATE: Macro to mark static and global variables to keep them when plugin is hot-reloaded.
CARB_STRINGIFY: Turns a name into a string, resolving macros (i.e.
CARB_STRINGIFY(__LINE__)
on line 815 will produce"815"
).CARB_TEGRA: A macro defined as
1
if compilation is targeting the Tegra platform. By default set to1
only if__aarch64__
and__LINARO_RELEASE__
are defined;0
otherwise. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line.CARB_TOOLCHAIN_CLANG: A macro defined as
1
if a Clang-infrastructure toolchain is building the current file, that is, if__clang__
is defined;0
if not. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line.CARB_TSAN_ENABLED: A macro defined as
1
if the toolchain is building the current file with-fsanitize=thread
, that is, if__SANITIZE_THREAD__
is defined;0
otherwise. May be overridden by defining a different value before including this file or by specifying a different value on the compiler command line. Microsoft Visual Studio does not support thread sanitizer.CARB_UINT16_MAX: The maximum value that can be represented by
uint16_t
.CARB_UINT32_MAX: The maximum value that can be represented by
uint32_t
.CARB_UINT64_MAX: The maximum value that can be represented by
uint64_t
.CARB_ULLONG_MAX: The maximum value that can be represented by
unsigned long long
.CARB_UNIMPLEMENTED: A macro to mark functionality that has not been implemented yet.
CARB_UNLIKELY: If the current compiler is GCC, defined as
__builtin_expect(!!(<expr>), 0)
. Otherwise, defined as(!!(<expr>))
.CARB_UNLIKELY_IF: A helper for using both the CARB_UNLIKELY macro as well as the CARB_CPP20_UNLIKELY macro.
CARB_UNSUPPORTED_ARCHITECTURE: A macro to put into the
#else
branches when writing CPU architecture specific code.CARB_UNSUPPORTED_PLATFORM: A macro to put into
#else
branches when writing platform-specific code.CARB_USHRT_MAX: The maximum value that can be represented by
unsigned short
.CARB_VERSION_ATLEAST: A macro meant to be used in preprocessor
#if
statements.CARB_VIZ: A macro that can be used to indicate classes and members that participate in visualizers, such as carb.natvis . This is a reminder that these classes, members and types will require visualizer fixup if changes are made.
CARB_WEAKLINK: Syntactic sugar for
CARB_DECLSPEC(selectany) CARB_ATTRIBUTE(weak)
, used to enable weak linking.CARB_X86_64: A macro defined as
1
if compilation is targeting the x86-64 platform;0
otherwise. May not be overridden on the command line or by defining before including this file. Set to0
if__aarch64__
is defined,1
if__x86_64__
or_M_X64
are defined, and left undefined otherwise.DOXYGEN_EMPTY_CLASS: Used when declaring opaque types to prevent Doxygen from getting confused about not finding any implementation.
OMNI_API: Declares a symbol that is marked as externally exported. The symbol will be exported with C decorations. On Windows, this is expected to be exported from the containing DLL. On Linux, this is exported as having default visibility from the module instead of being hidden. This export tag should only be used when tagging exported symbols from within omni.core itself. Exported symbols in other modules (such as
omniGetModuleExports()
functions in implementation libraries) should use OMNI_MODULE_API instead.OMNI_APP_GLOBALS: Helper macro to declare globals needed my the omni library when using the omni library in an application.
OMNI_ASSERT: Like std::assert. Basically OMNI_FATAL_UNLESS, but compiles to a no-op in debug builds.
OMNI_ASSERT_ENABLED: Set to 1 to indicate that assertion checks are enabled. Set to 0 if assertion checks will just be ignored. This value will always be defined regardless of the current mode.
OMNI_ATTR: Provides additional contextual information to the 'omni.bind' code generation tool. This information is used to generated efficient bindings to the interface.
OMNI_BREAK_POINT: Triggers a breakpoint. If no debugger is attached, the program terminates.
OMNI_CATCH_ABI_EXCEPTION: Helper macro to catch exceptions and return them as omni::core::Result codes. Useful when writing ABI code.
OMNI_CHECK: Checks if the given condition is true, if not, the given optional message is printed to stdout and the program is terminated.
OMNI_CHECK_ENABLED: Indicates whether runtime checking is enabled. For the time being this is always set to
1
indicating that the default implementation should not be overridden. This may change in the future.OMNI_CORE_INIT: Initializes the omni library along with Carbonite. Ensures that both libraries will be cleaned up upon exit.
OMNI_CORE_START: Helper macro to startup the Carbonite framework and Omni type factory.
OMNI_CORE_STOP: Helper macro to shutdown the Carbonite framework and Omni type factory.
OMNI_CORE_STOP_FOR_BINDINGS: Helper macro to shutdown the Carbonite framework and Omni type factory, for script bindings.
OMNI_DECLARE_INTERFACE: Used to forward declare an interface.
OMNI_DEFINE_INTERFACE_API: Used to extend the omni.bind generated API layer.
OMNI_EXPORT: Grants a function external linkage in a dynamic library or executable.
OMNI_EXTERN_C: Declares a "C" exported external symbol. This uses the "C" name decoration style of adding an underscore to the start of the exported name.
OMNI_FAILED: Returns
true
if the given omni::core::Result is a failure code.OMNI_FATAL_UNLESS: This macro is surprisingly complex mainly because it accepts a variable number of arguments. If a single argument is given, a message in the following form is printed:
OMNI_FORCE_SYMBOL_LINK: Helper to force a symbol to be linked.
OMNI_GENERATED_API: Macro to access generated API of an interface.
OMNI_GLOBALS_ADD_DEFAULT_CHANNEL: Adds the
name_
as the default logging channel.OMNI_GLOBALS_ADD_DEFAULT_CHANNEL_1: Implementation detail. Do not directly use. Use OMNI_GLOBALS_ADD_DEFAULT_CHANNEL .
OMNI_ILauncher_PRIpid: Format code to use for the carb::launcher::ProcessId data type in printf() style format strings.
OMNI_LOG_ADD_CHANNEL: Defines the properties of a channel and adds it to a module specific list of channels.
OMNI_LOG_DECLARE_CHANNEL: Given a channel name (as a string), declares a global variable to identify the channel.
OMNI_LOG_DEFAULT_CHANNEL: The default channel variable to use when no channel is supplied to the
OMNI_LOG_*
macros.OMNI_LOG_DEFINE_CHANNEL: Defines the properties of a channel.
OMNI_LOG_ERROR: Logs a message at omni::log::Level::eError level.
OMNI_LOG_FATAL: Logs a message at omni::log::Level::eFatal level.
OMNI_LOG_INFO: Logs a message at omni::log::Level::eInfo level.
OMNI_LOG_VERBOSE: Logs a message at omni::log::Level::eVerbose level.
OMNI_LOG_WARN: Logs a message at omni::log::Level::eWarn level.
OMNI_LOG_WRITE: Logs a message.
OMNI_MODULE_ADD_LOG_CHANNEL: Adds a log channel to the logging system. The channel will be removed when the module is unloaded.
OMNI_MODULE_ADD_STRUCTURED_LOG_SCHEMA: adds a new schema to be registered after core startup.
OMNI_MODULE_API: Declares a function that is marked as externally exported. The symbol will be exported with C decorations. On Windows, this is expected to be exported from the containing DLL. On Linux, this is exported as having default visibility from the module instead of being hidden. This is intended for exported symbols in implementation libraries.
OMNI_MODULE_DEFINE_CARB_FUNCTIONS: Defines default implementations of global Carbonite functions for an Omni module.
OMNI_MODULE_DEFINE_LOCATION_FUNCTIONS: Defines functions centered around determining the current module's disk location.
OMNI_MODULE_DEFINE_OMNI_FUNCTIONS: Defines default implementations of global omni functions for a module.
OMNI_MODULE_EXPORT_ENTRY_BEGIN: Helper macro for defining an entry (i.e. omni::core::ModuleExportEntry ) in the export table (i.e. omni::core::ModuleExports ).
OMNI_MODULE_EXPORT_ENTRY_END: Helper macro for defining an entry in the export table.
OMNI_MODULE_GET_MODULE_DEPENDENCIES: Registers the function responsible for advertising the plugin's interface dependencies.
OMNI_MODULE_GLOBALS: Helper macro to declare globals needed by modules (i.e. plugins).
OMNI_MODULE_GLOBALS_BUILD_CONFIG_SYMBOLS: Defines global symbols intended to be used to statically analyze whether a given plugin is a debug or release build. In a debug build, the
g_carbIsDebugConfig
symbol will be present. In a release build, theg_carbIsReleaseConfig
symbol will be present. These symbols are not intended to be used at runtime, but rather to be able to determine the build configuration without having to load up the module in a process first.OMNI_MODULE_GLOBALS_WITHOUT_CARB: Helper macro to declare globals needed by modules (i.e. plugins).
OMNI_MODULE_ON_MODULE_CAN_UNLOAD: Registers the plugin's function that determines if the plugin can be unloaded. See omni::core::OnModuleCanUnloadFn for details.
OMNI_MODULE_ON_MODULE_LOAD: Registers the plugin's function who is responsible for advertising the available interface implementations in the plugin.
OMNI_MODULE_ON_MODULE_STARTED: Registers the plugin's function that will be called once the plugin is loaded. See omni::core::OnModuleStartedFn for threading consideration with this function.
OMNI_MODULE_ON_MODULE_UNLOAD: Registers the plugin's function who is responsible for cleaning up the plugin when the plugin is being unloaded.
OMNI_MODULE_REQUIRE_CARB_CLIENT_NAME: Requires that the owning omni::core::ITypeFactory provides a Carbonite client name: g_carbClientName .
OMNI_MODULE_REQUIRE_CARB_FRAMEWORK: Requires that the owning omni::core::ITypeFactory provides a Carbonite carb::Framework g_carbFramework .
OMNI_MODULE_REQUIRE_CARB_IASSERT: Requires that the owning omni::core::ITypeFactory provides a Carbonite carb::assert::IAssert g_carbAssert .
OMNI_MODULE_REQUIRE_CARB_IL10N: Requires that the owning omni::core::ITypeFactory provides a Carbonite carb::l10n::IL10n g_carbLocalization .
OMNI_MODULE_REQUIRE_CARB_ILOGGING: Requires that the owning omni::core::ITypeFactory provides a Carbonite carb::logging::ILogging g_carbLogging .
OMNI_MODULE_REQUIRE_CARB_IPROFILER: Requires that the owning omni::core::ITypeFactory provides a Carbonite carb::profiler::IProfiler g_carbProfiler .
OMNI_MODULE_SET_CARB_EXPORTS: Helper macro to set known export fields in omniModuleGetExports() related to Carbonite.
OMNI_MODULE_SET_EXPORTS: Helper macro to set known export fields in omniModuleGetExports() .
OMNI_MODULE_SET_EXPORTS_WITHOUT_CARB: Helper macro to set known export fields in omniModuleGetExports() .
OMNI_PLATFORM_LINUX: Set to
1
if compiling a Linux build. Set to0
otherwise. This symbol will always be defined even when not on a Linux build. It can thus be used to pass as parameters or in if-statements to modify behavior based on the platform.OMNI_PLATFORM_MACOS: Set to
1
if compiling a MacOS build. Set to0
otherwise. This symbol will always be defined even when not on a MacOS build. It can thus be used to pass as parameters or in if-statements to modify behavior based on the platform.OMNI_PLATFORM_WINDOWS: Set to
1
if compiling a Windows build. Set to0
otherwise. This symbol will always be defined even when not on a Windows build. It can thus be used to pass as parameters or in if-statements to modify behavior based on the platform.OMNI_PLUGIN_IMPL_DEPS: Provides a list of dependent interfaces for an ONI plugin.
OMNI_PLUGIN_IMPL_NODEPS: Declares that the calling plugin has no dependencies on any other Carbonite or ONI interfaces.
OMNI_PLUGIN_INTERFACE: Used to declare the interface description for an ONI object's API layer.
OMNI_POSIX: This is set to
_POSIX_VERSION
platforms that are mostly-compliant with POSIX.OMNI_PRIpid: The printf format macro to print a process ID.
OMNI_PRItid: The printf format macro to print a thread ID.
OMNI_PRIxpid: The printf format macro to print a process ID in hexadecimal.
OMNI_PRIxtid: The printf format macro to print a thread ID in hexadecimal.
OMNI_PYTHON_GLOBALS: Declare a compilation unit as script language bindings.
OMNI_RETURN_ERROR: Helper macro used to return a omni::core::Result . When in debug mode and attached to a debugger, this macro will cause a debugger break. Useful for determining the origin of an error.
OMNI_RETURN_IF_ARG_NULL: Helper macro to return an appropriate omni::core::Result when the given argument is
nullptr
. Useful when authoring ABI code.OMNI_RETURN_IF_FAILED: If the given omni::core::Result is a failure code, calls
return result
to exit the current function.OMNI_STRUCTURED_LOG: Common entry point for sending an event.
OMNI_STRUCTURED_LOG_ADD_SCHEMA: Sets that a schema should be registered on module load.
OMNI_STRUCTURED_LOG_EVENT_ID: Helper macro to piece together a unique event name to generate an ID from.
OMNI_SUCCEEDED: Returns
true
if the given omni::core::Result is not a failure code.OMNI_THROW_IF_ARG_NULL: Helper macro to throw a omni::core::ResultError exception if a function argument is
nullptr
. Used heavily by omni.bind .OMNI_THROW_IF_FAILED: Helper macro to convert a omni::core::Result to a omni::core::ResultError exception. Useful when authoring API code. Used heavily by omni.bind .
OMNI_TYPE_ID: Returns the type id of the given type name at compile time.
OMNI_USE_FROM_GENERATED_API: Used in cases when defined interface provides an overload for a function from generated API.
PERSISTENT_SETTINGS_PREFIX: The settings prefix to indicate that a setting is persistent.
SETTING_SEP: The separator character used by carb.settings .
carb_crashreporter_ICrashReporter: The default current version for carb::crashreporter::ICrashReporter .
carb_crashreporter_ICrashReporter_latest: Latest version for carb::crashreporter::ICrashReporter .
carb_logging_ILogging: The default current version for carb::logging::ILogging .
carb_logging_ILogging_latest: Latest version for carb::logging::ILogging .
carb_stats_IStats: The current default IStats interface version.
carb_stats_IStats_latest: Latest IStats interface version.