diff options
-rw-r--r-- | slicer/slicer/modelPartsTypes.impl.h | 6 | ||||
-rw-r--r-- | slicer/tool/parser.cpp | 14 |
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) { |