Add support for C-style enums in C mode. And tests.

In backward compatible mode C style enums binding are correctly
generated
This commit is contained in:
Artem Serebriyskiy 2013-11-13 15:16:09 +04:00
commit 6d49a57b53
2 changed files with 21 additions and 2 deletions

View file

@ -19,4 +19,12 @@ assert(enums.globalinstance3==30)
assert(enums.AnonEnum1==0)
assert(enums.AnonEnum2==100)
-- In C enums from struct are exported without prefixing with struct name
-- In C++ they are prefixed.
-- We are emulating xor :)
assert(enums.BAR1 ~= enums.Foo_BAR1) -- It is either C style, or C++ style, but not both
assert((enums.BAR1 ~= nil ) or (enums.Foo_BAR1 ~= nil))
assert(enums.Phoo ~= enums.iFoo_Phoo)
assert((enums.Phoo == 50) or (enums.iFoo_Phoo == 50))
-- no point in checking fns, C will allow any value