M
Mockey Chen
I using #define as following:
#include <stdio.h>
#define LOG_PREFIX "Current function: <" __FUNCTION__ ">: "
int main()
{
printf(LOG_PREFIX "some thing.\n");
return 0;
}
I complie and got error:
% cc func.c
func_test.c: In function `main':
func_test.c:6: error: syntax error before "__FUNCTION__"
I want to use LOG_PREFIX macro automatice expand.
Is there any way to do it?
Thanks in advance.
--
Regards.
Mockey Chen
#include <stdio.h>
#define LOG_PREFIX "Current function: <" __FUNCTION__ ">: "
int main()
{
printf(LOG_PREFIX "some thing.\n");
return 0;
}
I complie and got error:
% cc func.c
func_test.c: In function `main':
func_test.c:6: error: syntax error before "__FUNCTION__"
I want to use LOG_PREFIX macro automatice expand.
Is there any way to do it?
Thanks in advance.
--
Regards.
Mockey Chen