summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-21 14:21:29 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-21 14:21:29 +0000
commit4a8bd7772084d0154279e6797feff821c1742d81 (patch)
tree86dc0a31ca4ed7bc999c7e7023794e1b2ab22031
parentFix case where prefix view could be of a moved string (diff)
downloadslicer-4a8bd7772084d0154279e6797feff821c1742d81.tar.bz2
slicer-4a8bd7772084d0154279e6797feff821c1742d81.tar.xz
slicer-4a8bd7772084d0154279e6797feff821c1742d81.zip
Don't generate static macrosslicer-1.10.5.2
Moves FORWARD_ENUM into impl header
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h6
-rw-r--r--slicer/tool/parser.cpp14
2 files changed, 6 insertions, 14 deletions
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h
index 346a894..ba30abe 100644
--- a/slicer/slicer/modelPartsTypes.impl.h
+++ b/slicer/slicer/modelPartsTypes.impl.h
@@ -78,6 +78,12 @@
} \
}
+#ifdef ICE_CPP11_MAPPING // C++11 mapping
+# define FORWARD_ENUM(name) enum class ICE_CLASS(JAM_DLL_PUBLIC) name : unsigned char;
+#else // C++98 mapping
+# define FORWARD_ENUM(name) enum ICE_CLASS(JAM_DLL_PUBLIC) name;
+#endif
+
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wundefined-var-template"
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index 7759ebc..91407bc 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -43,20 +43,6 @@ namespace Slicer {
ForwardDeclare(FILE * c, const Count & cnt) : cpp(c), count(cnt) { }
bool
- visitUnitStart(const Slice::UnitPtr &) override
- {
- if (count.enums) {
- fprintbf(cpp, "#ifdef ICE_CPP11_MAPPING // C++11 mapping\n");
- fprintbf(
- cpp, "#define FORWARD_ENUM(name) enum class ICE_CLASS(JAM_DLL_PUBLIC) name : unsigned char;\n");
- fprintbf(cpp, "#else // C++98 mapping\n");
- fprintbf(cpp, "#define FORWARD_ENUM(name) enum ICE_CLASS(JAM_DLL_PUBLIC) name;\n");
- fprintbf(cpp, "#endif\n\n");
- }
- return true;
- }
-
- bool
visitModuleStart(const Slice::ModulePtr & m) override
{
if (count.classes || count.structs || count.enums) {