swig/Examples/test-suite/naturalvar_onoff.i
William S Fulton c34d7f6d23 %naturalvar feature fixes and documentation
Fix and document the naturalvar feature override behaviour - the naturalvar
feature attached to a variable name has precedence over the naturalvar
feature attached to the variable's type. The overriding was not working
when turning the feature off on the variable's name.

Fix so that any use of the naturalvar feature will override the global
setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
use of the naturalvar feature was not always honoured.
2014-01-11 19:32:43 +00:00

29 lines
718 B
OpenEdge ABL

%module naturalvar_onoff
// Test naturalvar feature override is working -
// naturalvar on the variable name has priority over naturalvar on the variable's type
// Use runtime tests to differentiate between the const ref typemaps and pointer typemap -
// using the fact that NULL cannot be passed to the ref typemaps
%naturalvar Member1;
%nonaturalvar Member2;
%naturalvar Member3;
%nonaturalvar Vars::member3Off;
%nonaturalvar Member4;
%naturalvar Vars::member4On;
%inline %{
struct Member1 {};
struct Member2 {};
struct Member3 {};
struct Member4 {};
struct Vars {
Member1 member1On;
Member2 member2Off;
Member3 member3Off;
Member3 member3On;
Member4 member4Off;
Member4 member4On;
};
%}