add SG_ORIGIN macro that expands to a string __FILE__":"__LINE__

Note that __LINE__ is a number and can't be directly used in string
context, which makes the macro worthwhile. (IMHO :-)
This commit is contained in:
mfranz 2007-07-02 12:55:10 +00:00
parent 741c4ca15a
commit a25eebef9b

View File

@ -322,6 +322,9 @@ sglog()
# define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << endl # define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << endl
#endif #endif
#define SG_STRINGIFY(x) #x
#define SG_TOSTRING(x) SG_STRINGIFY(x)
#define SG_ORIGIN __FILE__ ":" SG_TOSTRING(__LINE__)
#endif // _LOGSTREAM_H #endif // _LOGSTREAM_H