diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-07-05 19:19:24 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-07-05 19:19:24 +0100 | 
| commit | 9e86e23b430ad1bdab245b1e63c35b7a1ea73e03 (patch) | |
| tree | 6e07ace5f526f1c42dc5a23fcaa4532f360b7fea | |
| parent | Fix link error with containers defined in same slice as element (diff) | |
| download | slicer-9e86e23b430ad1bdab245b1e63c35b7a1ea73e03.tar.bz2 slicer-9e86e23b430ad1bdab245b1e63c35b7a1ea73e03.tar.xz slicer-9e86e23b430ad1bdab245b1e63c35b7a1ea73e03.zip | |
Apply previous fixes for classes to structs too
| -rw-r--r-- | slicer/test/preprocessor.cpp | 4 | ||||
| -rw-r--r-- | slicer/test/serializers.cpp | 3 | ||||
| -rw-r--r-- | slicer/test/structs.ice | 1 | ||||
| -rw-r--r-- | slicer/tool/parser.cpp | 7 | 
4 files changed, 12 insertions, 3 deletions
| diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp index eddeb31..2513f99 100644 --- a/slicer/test/preprocessor.cpp +++ b/slicer/test/preprocessor.cpp @@ -12,7 +12,7 @@  using ComponentsCount = std::map<std::string, unsigned int>;  ComponentsCount COMPONENTS_IN_TEST_ICE = {{"classtype.ice", 2}, {"classes.ice", 3}, {"collections.ice", 5},  		{"enums.ice", 2}, {"inheritance.ice", 12}, {"interfaces.ice", 0}, {"json.ice", 2}, {"locals.ice", 7}, -		{"optionals.ice", 2}, {"structs.ice", 4}, {"types.ice", 3}, {"xml.ice", 5}}; +		{"optionals.ice", 2}, {"structs.ice", 5}, {"types.ice", 3}, {"xml.ice", 5}};  unsigned int  total() @@ -21,7 +21,7 @@ total()  			COMPONENTS_IN_TEST_ICE.begin(), COMPONENTS_IN_TEST_ICE.end(), 0U, [](auto & t, auto && c) {  				return t += c.second;  			}); -	BOOST_CHECK_EQUAL(47, t); +	BOOST_CHECK_EQUAL(48, t);  	return t;  } diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp index c8f8390..53c6965 100644 --- a/slicer/test/serializers.cpp +++ b/slicer/test/serializers.cpp @@ -694,5 +694,6 @@ BOOST_AUTO_TEST_CASE(enum_lookups)  BOOST_AUTO_TEST_CASE(sequence_element_in_same_slice_link_bug)  {  	// Link error when sequence element type defined in same slice. -	Slicer::ModelPartForSequence<TestModule::Classes> mp(nullptr); +	Slicer::ModelPartForSequence<TestModule::Classes> mpClasses(nullptr); +	Slicer::ModelPartForSequence<TestModule::Dates> mpDates(nullptr);  } diff --git a/slicer/test/structs.ice b/slicer/test/structs.ice index fcd17fe..8edb585 100644 --- a/slicer/test/structs.ice +++ b/slicer/test/structs.ice @@ -29,6 +29,7 @@ module TestModule {  		StructType str;  		int simp;  	}; +	sequence<IsoDate> Dates;  };  #endif diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index d2288ae..3d0505a 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -31,6 +31,13 @@ namespace Slicer {  			return false;  		}; +		bool +		visitStructStart(const Slice::StructPtr & s) override +		{ +			fprintbf(cpp, "struct ICE_CLASS(JAM_DLL_PUBLIC) %s;\n", s->name()); +			return false; +		}; +  		void  		visitModuleEnd(const Slice::ModulePtr & m) override  		{ | 
