summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/eolian_mono/eolian/mono/utils.hh8
-rw-r--r--src/bin/eolian_mono/eolian/mono/variable_definition.hh6
-rw-r--r--src/tests/efl_mono/Eo.cs4
3 files changed, 16 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/utils.hh b/src/bin/eolian_mono/eolian/mono/utils.hh
index 0912db8a71..cbea48afa3 100644
--- a/src/bin/eolian_mono/eolian/mono/utils.hh
+++ b/src/bin/eolian_mono/eolian/mono/utils.hh
@@ -70,6 +70,14 @@ namespace eolian_mono { namespace utils {
70 name.erase(std::remove(name.begin(), name.end(), target), name.end()); 70 name.erase(std::remove(name.begin(), name.end(), target), name.end());
71 return name; 71 return name;
72 } 72 }
73
74 inline bool ends_with(std::string const& source, std::string suffix)
75 {
76 if (source.size() > suffix.size())
77 return (0 == source.compare(source.size() - suffix.size(), suffix.size(), suffix));
78 else
79 return false;
80 }
73} } 81} }
74 82
75#endif 83#endif
diff --git a/src/bin/eolian_mono/eolian/mono/variable_definition.hh b/src/bin/eolian_mono/eolian/mono/variable_definition.hh
index 2a0eac30d6..d143d7e138 100644
--- a/src/bin/eolian_mono/eolian/mono/variable_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/variable_definition.hh
@@ -47,8 +47,14 @@ struct constant_definition_generator
47 auto lit = ::eolian_expression_value_to_literal(&constant.expression_value); 47 auto lit = ::eolian_expression_value_to_literal(&constant.expression_value);
48 if (!lit) 48 if (!lit)
49 return false; 49 return false;
50
50 literal = lit; 51 literal = lit;
51 ::eina_stringshare_del(lit); 52 ::eina_stringshare_del(lit);
53
54 // Cleanup suffix. Roslyn does not accept ULL/LL as it has only longs.
55 if (utils::ends_with(literal, "LL") || utils::ends_with(literal, "ll"))
56 literal = literal.substr(0, literal.size() -1);
57
52 } 58 }
53 59
54 // declare variable 60 // declare variable
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 3e7f662151..9da7752e4b 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -199,8 +199,8 @@ class TestVariables
199 Test.AssertEquals(Dummy.Constants.ConstvarUInt, 65533U); 199 Test.AssertEquals(Dummy.Constants.ConstvarUInt, 65533U);
200 Test.AssertEquals(Dummy.Constants.ConstvarLong, -2147483644L); 200 Test.AssertEquals(Dummy.Constants.ConstvarLong, -2147483644L);
201 Test.AssertEquals(Dummy.Constants.ConstvarULong, 4294967288UL); 201 Test.AssertEquals(Dummy.Constants.ConstvarULong, 4294967288UL);
202 //Test.AssertEquals(Dummy.Constants.ConstvarLLong, -9223372036854775800); // TODO 202 Test.AssertEquals(Dummy.Constants.ConstvarLLong, -9223372036854775800);
203 //Test.AssertEquals(Dummy.Constants.ConstvarULLong, 18446744073709551615); 203 Test.AssertEquals(Dummy.Constants.ConstvarULLong, 18446744073709551615);
204 Test.AssertEquals(Dummy.Constants.ConstvarFloat, 16777211.0f); 204 Test.AssertEquals(Dummy.Constants.ConstvarFloat, 16777211.0f);
205 Test.AssertEquals(Dummy.Constants.ConstvarDouble, 9007199254740988.0); 205 Test.AssertEquals(Dummy.Constants.ConstvarDouble, 9007199254740988.0);
206 Test.AssertEquals(Dummy.Constants.ConstvarChar, '!'); 206 Test.AssertEquals(Dummy.Constants.ConstvarChar, '!');