swig/Examples/test-suite/default_arg_values.i
William S Fulton 52e59d530d gcc-4.5 warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12529 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-12 21:37:35 +00:00

18 lines
649 B
OpenEdge ABL

%module default_arg_values
%{
struct Display {
// Some compilers warn about 'float v = NULL', so only SWIG sees this peculiarity
// Bad Python wrappers were being generated when NULL used for primitive type
float draw1(float v = 0) { return v; }
float draw2(float *v = 0) { return v ? *v : 0; }
};
float* createPtr(float v) { static float val; val = v; return &val; }
%}
struct Display {
// Bad Python wrappers were being generated when NULL used for primitive type
float draw1(float v = NULL) { return v; }
float draw2(float *v = NULL) { return v ? *v : 0; }
};
float* createPtr(float v) { static float val; val = v; return &val; }