From 4bef02e7aa60c48df923d778ae33438e573ec7bc Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 3 Apr 2014 21:28:10 +0200 Subject: [PATCH] cmTypeMacro: Add a class to eat the semicolon following the macro use. Apply the same workaround to the cmCPackTypeMacro. Additionally change that macro to not use 'class' as a macro parameter. --- Source/CPack/cmCPackGenerator.h | 7 ++++--- Source/cmStandardIncludes.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index efd3bef73..e780f0e64 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -22,9 +22,10 @@ // Forward declarations are insufficient since we use them in // std::map data members below... -#define cmCPackTypeMacro(class, superclass) \ - cmTypeMacro(class, superclass); \ - static cmCPackGenerator* CreateGenerator() { return new class; } +#define cmCPackTypeMacro(klass, superclass) \ + cmTypeMacro(klass, superclass); \ + static cmCPackGenerator* CreateGenerator() { return new klass; } \ + class cmCPackTypeMacro_UseTrailingSemicolon #define cmCPackLogger(logType, msg) \ do { \ diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index ed8efcc68..a54489424 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -378,7 +378,8 @@ static thisClass* SafeDownCast(cmObject *c) \ return static_cast(c); \ } \ return 0;\ -} +} \ +class cmTypeMacro_UseTrailingSemicolon inline bool cmHasLiteralPrefixImpl(const std::string &str1, const char *str2,