From a25eebef9b4cd549da9417029f2f18996f26afbf Mon Sep 17 00:00:00 2001 From: mfranz Date: Mon, 2 Jul 2007 12:55:10 +0000 Subject: [PATCH] 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 :-) --- simgear/debug/logstream.hxx | 3 +++ 1 file changed, 3 insertions(+) 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