ADTF
preprocessor functionality

Component for common preprocessor functionality and macros - applicable using

#include <a_util/preprocessor.h> More...

Macros

#define A_UTIL_CURRENT_FUNCTION   BOOST_CURRENT_FUNCTION
 Resolves to the name of the function this macro is used in.
 
#define DEV_ESSENTIAL_DEPRECATED(msg)
 Adds [[deprecated("msg")]] to allowed declarations. More...
 
#define DEV_ESSENTIAL_DEPRECATED_MACRO(macro_name, reason)
 A function like macro usable inside other macro definitions to warn about their deprecation. More...
 
#define A_UTIL_DISABLE_COMPILER_WARNINGS
 Disables all compiler warnings until A_UTIL_ENABLE_COMPILER_WARNINGS is found. More...
 
#define A_UTIL_ENABLE_COMPILER_WARNINGS
 Restores the compiler warning level to the state before A_UTIL_DISABLE_COMPILER_WARNINGS. More...
 
#define A_UTIL_DLL_EXPORT
 Defines standard exporting rules for symbol visibility. More...
 
#define A_UTIL_TO_STRING(expression)   A_UTIL_STRINGIFY(expression)
 Converts an expression to its string representation during preprocessing. More...
 

Detailed Description

Component for common preprocessor functionality and macros - applicable using

#include <a_util/preprocessor.h>

Macro Definition Documentation

◆ A_UTIL_DISABLE_COMPILER_WARNINGS

#define A_UTIL_DISABLE_COMPILER_WARNINGS

Disables all compiler warnings until A_UTIL_ENABLE_COMPILER_WARNINGS is found.

Might be used to disable warnings for third-party includes that cannot be changed. Example:

// disables ALL wanings
#include <some/thirdparty/header.h>
// must be called to restore the previous warning state
#define A_UTIL_DISABLE_COMPILER_WARNINGS
Disables all compiler warnings until A_UTIL_ENABLE_COMPILER_WARNINGS is found.
#define A_UTIL_ENABLE_COMPILER_WARNINGS
Restores the compiler warning level to the state before A_UTIL_DISABLE_COMPILER_WARNINGS.
Note
For internal usage only

Definition at line 46 of file disable_warnings.h.

◆ A_UTIL_DLL_EXPORT

#define A_UTIL_DLL_EXPORT

Defines standard exporting rules for symbol visibility.

Macro for switching between export / import.

Definition at line 40 of file dll_export.h.

◆ A_UTIL_ENABLE_COMPILER_WARNINGS

#define A_UTIL_ENABLE_COMPILER_WARNINGS

Restores the compiler warning level to the state before A_UTIL_DISABLE_COMPILER_WARNINGS.

For an example, see A_UTIL_DISABLE_COMPILER_WARNINGS.

Note
For internal usage only

Definition at line 47 of file disable_warnings.h.

◆ A_UTIL_TO_STRING

#define A_UTIL_TO_STRING (   expression)    A_UTIL_STRINGIFY(expression)

Converts an expression to its string representation during preprocessing.

Parameters
[in]expressionThe expression evaluating to the string representation.

Definition at line 31 of file to_string.h.

◆ DEV_ESSENTIAL_DEPRECATED

#define DEV_ESSENTIAL_DEPRECATED (   msg)
Value:
[[deprecated(msg " To disable this warning, define " \
"DEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS.")]]

Adds [[deprecated("msg")]] to allowed declarations.

Parameters
[in]msgText explaining the rationale for deprecation and/or to suggest a replacing entity
Remarks
Might be disabled by defining preprocessor define DEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS.
Allowed declarations are listed here: https://en.cppreference.com/w/cpp/language/attributes/deprecated#Explanation.

Definition at line 44 of file deprecated.h.

◆ DEV_ESSENTIAL_DEPRECATED_MACRO

#define DEV_ESSENTIAL_DEPRECATED_MACRO (   macro_name,
  reason 
)
Value:
DEV_ESSENTIAL_INTERNAL_PRAGMA_WARNING( \
#macro_name is deprecated and will be removed in an upcoming version. Reason: reason \
Compile with -DDEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS to disable this warning.)

A function like macro usable inside other macro definitions to warn about their deprecation.

Example:

// First parameter of DEV_ESSENTIAL_DEPRECATED_MACRO() is not a string!
// Also do not forget the dot ',' concluding the reason.
#define MY_FANCY_MACRO(x) \
DEV_ESSENTIAL_DEPRECATED_MACRO(MY_FANCY_MACRO, "Use MY_EVEN_FANCIER_MACRO instead.") \
doFancyStuff(x)
Parameters
[in]macro_nameName of the macro that shall be marked deprecated (not a string!)
[in]reasonA string explaining the reason of deprecation.
Remarks
For Visual Studio the emitted string is a simple message. For other compilers (e.g. GCC, clang) the emitted string is treated as warning. To silence the message/warning, DEV_ESSENTIAL_DISABLE_DEPRECATED_WARNINGS can be defined.

Definition at line 76 of file deprecated.h.