From 75564786d4db74ee37f5af7d4aa03091e46817cc Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 16 Oct 2006 04:51:46 +0000 Subject: [PATCH] Generate a "unique" name based on line numbers. --- stepmania/src/global.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/global.h b/stepmania/src/global.h index e19a992657..c6c1a6f947 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -119,6 +119,12 @@ void ShowWarning( const char *file, int line, const char *message ); // don't pu #define DEBUG_ASSERT_M(x,y) #endif +/* Use UNIQUE_NAME to get the line number concatenated to x. This is useful for + * generating unique identifiers in other macros. */ +#define UNIQUE_NAME3(x,line) x##line +#define UNIQUE_NAME2(x,line) UNIQUE_NAME3(x, line) +#define UNIQUE_NAME(x) UNIQUE_NAME2(x, __LINE__) + template struct CompileAssert; template <> struct CompileAssert { }; template struct CompileAssertDecl { };