First, it declares the macro LOG_DBG(x)
just like this:
#define LOG_DBG(x)
And then, use it like this:
LOG_DBG((LOG_MISC, 80, __FUNCTION__": select reports %d", res));
And I can't understand what the macro means ? What it will do ?
It does exactly nothing. It gets preprocessed to an empty string. This may be a somewhat convenient way of disabling/enabling debug log messages. The code was probably written like this at some point:
#define LOG_DBG(x) some_logging_function(x)
But then someone wanted to simply get rid of all the log messages in one shot.
It will do nothing. You're seeing the "disabled" form of the macro, which is used to make the logging calls go away on non-debug builds.
There should be another declaration of the macro somewhere, or the code is perhaps just "left" in the non-debugging state.
You've defined a macro that receives x as parameter but do nothing. Here's a concrete use of macro:
#include <stdio.h>
#define LOG_DBG(x) ((x)+5)
int main(int argc, char *argv[])
{
int x = LOG_DBG(3);
printf("%d\n", x);
return 0;
}
Here, we did something in the macro and hence the number 8 will be printed.
Of course, if you want the logarithm of x, it would be another expression.