Fix %feature not working for conversion operators
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11123 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a4906b8182
commit
30d73c82cd
4 changed files with 27 additions and 2 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
Version 1.3.39 (in progress)
|
Version 1.3.39 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2008-02-08: wsfulton
|
||||||
|
Fix %feature not working for conversion operators, reported by Matt Sprague, for example:
|
||||||
|
%feature("cs:methodmodifiers") operator bool "protected";
|
||||||
|
|
||||||
2008-02-07: wsfulton
|
2008-02-07: wsfulton
|
||||||
[MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions.
|
[MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions.
|
||||||
Also fixes Makefile errors building SWIG executable when mzscheme package is installed
|
Also fixes Makefile errors building SWIG executable when mzscheme package is installed
|
||||||
|
|
|
||||||
|
|
@ -162,3 +162,20 @@ namespace Space {
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// Test 8 conversion operators
|
||||||
|
%rename(opbool) operator bool;
|
||||||
|
%rename(opuint) operator unsigned int;
|
||||||
|
|
||||||
|
%exception ConversionOperators::ConversionOperators() "$action /* ConversionOperators::ConversionOperators() */";
|
||||||
|
%exception ConversionOperators::~ConversionOperators() "$action /* ConversionOperators::~ConversionOperators() */";
|
||||||
|
%exception ConversionOperators::operator bool "$action /* ConversionOperators::operator bool */";
|
||||||
|
%exception ConversionOperators::operator unsigned int "$action /* ConversionOperators::unsigned int*/";
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
class ConversionOperators {
|
||||||
|
public:
|
||||||
|
operator bool() { return false; }
|
||||||
|
operator unsigned int() { return 0; }
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -711,6 +711,10 @@ int yylex(void) {
|
||||||
termtoken = SWIG_TOKEN_SEMI;
|
termtoken = SWIG_TOKEN_SEMI;
|
||||||
termvalue = ";";
|
termvalue = ";";
|
||||||
break;
|
break;
|
||||||
|
} else if (nexttok == SWIG_TOKEN_STRING) {
|
||||||
|
termtoken = SWIG_TOKEN_STRING;
|
||||||
|
termvalue = Swig_copy_string(Char(Scanner_text(scan)));
|
||||||
|
break;
|
||||||
} else if (nexttok == SWIG_TOKEN_ID) {
|
} else if (nexttok == SWIG_TOKEN_ID) {
|
||||||
if (needspace) {
|
if (needspace) {
|
||||||
Append(s," ");
|
Append(s," ");
|
||||||
|
|
|
||||||
|
|
@ -655,7 +655,7 @@ void Swig_features_get(Hash *features, String *prefix, String *name, SwigType *d
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stdout, "Swig_features_get: %s %s %s\n", prefix, name, decl);
|
Printf(stdout, "Swig_features_get: '%s' '%s' '%s'\n", prefix, name, decl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Global features */
|
/* Global features */
|
||||||
|
|
@ -732,7 +732,7 @@ void Swig_feature_set(Hash *features, const_String_or_char_ptr name, SwigType *d
|
||||||
Hash *fhash;
|
Hash *fhash;
|
||||||
|
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stdout, "Swig_feature_set: %s %s %s %s\n", name, decl, featurename, value);
|
Printf(stdout, "Swig_feature_set: '%s' '%s' '%s' '%s'\n", name, decl, featurename, value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
n = Getattr(features, name);
|
n = Getattr(features, name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue