From: mfranz Date: Mon, 2 Jul 2007 12:55:10 +0000 (+0000) Subject: add SG_ORIGIN macro that expands to a string __FILE__":"__LINE__ X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a25eebef9b4cd549da9417029f2f18996f26afbf;p=simgear.git 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 :-) --- diff --git a/simgear/debug/logstream.hxx b/simgear/debug/logstream.hxx index 3bc49a76..c4ea7834 100644 --- a/simgear/debug/logstream.hxx +++ b/simgear/debug/logstream.hxx @@ -322,6 +322,9 @@ sglog() # define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << endl #endif +#define SG_STRINGIFY(x) #x +#define SG_TOSTRING(x) SG_STRINGIFY(x) +#define SG_ORIGIN __FILE__ ":" SG_TOSTRING(__LINE__) #endif // _LOGSTREAM_H