//inline2.cpp
#include <stdio.h>

//example of pre-processor expanding file and line variables
#define DEBUG(string) \
printf("File:%s, Line:%d - %s\n",__FILE__,__LINE__,string);

//example of how one must add this to call of inline version
inline void debug(char* string, char* file=__FILE__,int line=__LINE__) {
printf("File:%s, Line:%d - %s\n",file,line,string);
}

//example of how could simplify call of inline version
#define FL	__FILE__,__LINE__

main()	{
   DEBUG("line1");
   DEBUG("line2");
   debug("line3");
   debug("line4");
   debug("line5",__FILE__,__LINE__);
   debug("line6",FL);
}
/*output*
File:INLINE2.CPP, Line:17 - line1
File:INLINE2.CPP, Line:18 - line2
File:INLINE2.CPP, Line:9 - line3
File:INLINE2.CPP, Line:9 - line4
File:INLINE2.CPP, Line:21 - line5
File:INLINE2.CPP, Line:22 - line6
********/

//end inline2.cpp

