oled 1.0
OLED Graphics Control Library
|
Helper macros for stringification in C preprocessor. More...
Go to the source code of this file.
Macros | |
#define | _STR2(x) |
Converts a macro argument into a string literal (internal helper). | |
#define | _STR(x) |
Converts a macro argument into a string literal (with expansion). |
Helper macros for stringification in C preprocessor.
This header file provides macros for converting tokens or macro values into string literals using the C preprocessor.
It contains two essential macros:
These utilities are commonly used when embedding macro constants into message strings, compiler attributes, or debug output.
#define _STR | ( | x | ) |
Converts a macro argument into a string literal (with expansion).
This macro first expands its argument x (if it is another macro), and then calls _STR2(x) to convert it into a string literal.
For example:
x | Token or macro to be expanded and converted into a string literal. |
#define _STR2 | ( | x | ) |
Converts a macro argument into a string literal (internal helper).
This macro takes a single argument x and applies the preprocessor stringization operator (#), converting the token into a string literal. It is usually not used directly, but rather invoked via the higher-level macro _STR(), which ensures proper macro expansion before stringization.
x | Token to be converted into a string literal. |