Hi, all.
I'm playing with HAXE these days. Trying to make cross-platform library and I need for it dynamically added setters and getters.
As I see it works on Flash and Windows but when I try to compile for Android I get following error:
./src/be/zajac/test/Test.cpp: In member function 'virtual Dynamic be::zajac::test::Test_obj::__Field(const String&, bool)':
./src/be/zajac/test/Test.cpp:307: error: operands to ?: have different types 'Dynamic' and 'int'
Which is related to this line:
public var backgroundColor(dynamic, dynamic): Int;
But when I replace Int with Dynamic it passes compilation and it works.
As this is library I want to limit 3rd party to set other values than Int.
I was digging deeper and figure out why is this error raising. My backgroundColor variable is compiled to Test.h file as this:
int backgroundColor; /* REM */
Dynamic get_backgroundColor;
Dynamic set_backgroundColor;
And in Test.cpp getting value from backgroundColor is compiled like this:
if (HX_FIELD_EQ(inName,"backgroundColor") ) { return inCallProp ? get_backgroundColor() : backgroundColor; }
so VisualC++ do not care about data type returned after "?", but Android NDK is strict in this case.
Is there any way to solve this situation? I need interface to stay as it is.
Boky