I have a macro that passes the line number and file name to an error handler:
#define SYSTEM_FAILURE (error_code, comment) \
System_Failure((error_code), (comment), __LINE__, __FILE__);
How will the __LINE__
be resolved when used inside an inlined function?
file.h:
inline int divide(int x, int y)
{
if (y == 0)
{
SYSTEM_FAILURE(ENUM_DIVIDE_BY_ZERO, "divide by zero error");
}
return x/y;
}
Will __LINE__
contain the line number within the header file, or the line number of the source file where the inline function is called (assuming compiler does a "paste" in the source code)?
my preprocessor does this, is it standard?
) would have (and still can) neuter many of the downvotes. – Azotize