summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-03 21:28:10 +0200
committerStephen Kelly <steveire@gmail.com>2014-04-03 21:53:13 +0200
commit4bef02e7aa60c48df923d778ae33438e573ec7bc (patch)
tree75ca33190733919d9e5d7431820bb97c3604f25e /Source
parentff710539ab31ba4b6f3b376621dd9fbd56e1b558 (diff)
downloadcmake-4bef02e7aa60c48df923d778ae33438e573ec7bc.tar.gz
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackGenerator.h7
-rw-r--r--Source/cmStandardIncludes.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index efd3bef736..e780f0e64b 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 ed8efcc68b..a544894240 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -378,7 +378,8 @@ static thisClass* SafeDownCast(cmObject *c) \
return static_cast<thisClass *>(c); \
} \
return 0;\
-}
+} \
+class cmTypeMacro_UseTrailingSemicolon
inline bool cmHasLiteralPrefixImpl(const std::string &str1,
const char *str2,