From 40267cad05d4a39e0978090aa5e8f1f3124ececc Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 12 Apr 2012 14:06:59 +1000 Subject: [PATCH] Add macro that creates unique variable names --- debug.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debug.hpp b/debug.hpp index cc4d19f1..1b3eef7a 100644 --- a/debug.hpp +++ b/debug.hpp @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with libgim. If not, see . * - * Copyright 2010 Danny Robson + * Copyright 2010-2012 Danny Robson */ #ifndef __DEBUG_HPP @@ -28,6 +28,10 @@ #include #include +#define CONCATENATE_DETAIL(x, y) x##y +#define CONCATENATE(x, y) CONCATENATE_DETAIL(x, y) +#define raii CONCATENATE(unique, __COUNTER__) + #define trace { \ std::cerr << __FILE__ << ":" << __func__ << ":" << __LINE__ << std::endl; \ }