Menu

Include level macro

Cyder

Include Level Macro

Config: #define TPP_CONFIG_HAVE___INCLUDE_DEPTH__ 0/1
Check: #if defined(__INCLUDE_LEVEL__) || defined(__INCLUDE_DEPTH__)
Function: tpp.c: TPPLexer_Next
Known supporting compilers: ?

A builtin macro, that expands to and integral constant similar to __LINE__, but instead of yielding the current line, it will yield the recursion depth of #include directives, that lead to the current preprocessor state.

Note: Before v105 only __INCLUDE_LEVEL__ got defined. To fix this, simply include the following code:

#if defined(__INCLUDE_LEVEL__) && !defined(__INCLUDE_DEPTH__)
#define __INCLUDE_DEPTH__ __INCLUDE_LEVEL__
#endif

s.a. [Line macro]


Related

Wiki: Line macro