Hello,
gcc 4.4.2 c89
I have the following code.
#if defined ( __linux__ )
log_msg(stderr, "Socket failed [ %s ] [ %s ] [ %d ]\n",
strerror(errno), __func__, __LINE__);
#elif ( WIN32 )
log_msg(stderr, "Socket failed [ %s ] [ %s ] [ %d ]\n",
strerror(errno), __FUNCTION__, __LINE__);
#endif
Because I am compiling on both windows and linux I have to separate is log_msg as above as they use different macros for getting the function name FUNCTION AND func.
However, I have many of these log_msg to write and just wondering is there anyway I can avoid having to write this twice for the sake of one macro being different?
many thanks for any advice,