Removed last vestiges of enums being handled as integers in the core.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6773 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-11-28 18:53:17 +00:00
commit ed1415ebad

View file

@ -643,7 +643,7 @@ SwigType_ltype(SwigType *s) {
if (SwigType_issimple(tc)) { if (SwigType_issimple(tc)) {
/* Resolve any typedef definitions */ /* Resolve any typedef definitions */
td = SwigType_typedef_resolve(tc); td = SwigType_typedef_resolve(tc);
if (td && (SwigType_isconst(td) || SwigType_isarray(td) || SwigType_isenum(td) || SwigType_isreference(td))) { if (td && (SwigType_isconst(td) || SwigType_isarray(td) || SwigType_isreference(td))) {
/* We need to use the typedef type */ /* We need to use the typedef type */
Delete(tc); Delete(tc);
tc = td; tc = td;
@ -653,6 +653,7 @@ SwigType_ltype(SwigType *s) {
} }
elements = SwigType_split(tc); elements = SwigType_split(tc);
nelements = Len(elements); nelements = Len(elements);
/* Now, walk the type list and start emitting */ /* Now, walk the type list and start emitting */
for (i = 0; i < nelements; i++) { for (i = 0; i < nelements; i++) {
element = Getitem(elements,i); element = Getitem(elements,i);
@ -683,7 +684,8 @@ SwigType_ltype(SwigType *s) {
} }
firstarray = 0; firstarray = 0;
} else if (SwigType_isenum(element)) { } else if (SwigType_isenum(element)) {
if (notypeconv) { int anonymous_enum = (Cmp(element,"enum ") == 0);
if (notypeconv || !anonymous_enum) {
Append(result,element); Append(result,element);
} else { } else {
Append(result,"int"); Append(result,"int");
@ -924,6 +926,7 @@ String *SwigType_manglestr_default(SwigType *s) {
Replace(base,"struct ","", DOH_REPLACE_ANY); /* This might be problematic */ Replace(base,"struct ","", DOH_REPLACE_ANY); /* This might be problematic */
Replace(base,"class ","", DOH_REPLACE_ANY); Replace(base,"class ","", DOH_REPLACE_ANY);
Replace(base,"union ","", DOH_REPLACE_ANY); Replace(base,"union ","", DOH_REPLACE_ANY);
Replace(base,"enum ","", DOH_REPLACE_ANY);
c = Char(base); c = Char(base);
while (*c) { while (*c) {