Fixed handling of constants. Previously if a %constant directive was defined before a #define it would not work correctly.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7578 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7141c63a44
commit
65a0a3b9f2
2 changed files with 4 additions and 3 deletions
|
|
@ -87,10 +87,10 @@
|
||||||
/* --- Constants --- */
|
/* --- Constants --- */
|
||||||
|
|
||||||
%typemap(constant) char
|
%typemap(constant) char
|
||||||
"rb_define_const($module,\"$symname\", rb_str_new(\"$1\",1));";
|
"rb_define_const($module,\"$symname\", rb_str_new($1,1));";
|
||||||
|
|
||||||
%typemap(constant) char *
|
%typemap(constant) char *
|
||||||
"rb_define_const($module,\"$symname\", rb_str_new2(\"$1\"));";
|
"rb_define_const($module,\"$symname\", rb_str_new2($1));";
|
||||||
|
|
||||||
/* directorin typemaps */
|
/* directorin typemaps */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1578,7 +1578,8 @@ public:
|
||||||
|
|
||||||
char *iname = GetChar(n,"sym:name");
|
char *iname = GetChar(n,"sym:name");
|
||||||
SwigType *type = Getattr(n,"type");
|
SwigType *type = Getattr(n,"type");
|
||||||
char *value = GetChar(n,"value");
|
String *rawval = Getattr(n,"rawval");
|
||||||
|
String *value = rawval ? rawval : Getattr(n,"value");
|
||||||
|
|
||||||
if (current == CLASS_CONST) {
|
if (current == CLASS_CONST) {
|
||||||
iname = klass->strip(iname);
|
iname = klass->strip(iname);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue