diff --git a/dtool/src/cppparser/cppDeclaration.cxx b/dtool/src/cppparser/cppDeclaration.cxx index d7f108d44d..13c81e734d 100644 --- a/dtool/src/cppparser/cppDeclaration.cxx +++ b/dtool/src/cppparser/cppDeclaration.cxx @@ -399,3 +399,24 @@ is_less(const CPPDeclaration *other) const { return this < other; } + +ostream & +operator << (ostream &out, const CPPDeclaration::SubstDecl &subst) { + CPPDeclaration::SubstDecl::const_iterator it; + for (it = subst.begin(); it != subst.end(); ++it) { + out << " "; + if (it->first == NULL) { + out << "(null)"; + } else { + out << *(it->first); + } + out << " -> "; + if (it->second == NULL) { + out << "(null)"; + } else { + out << *(it->second); + } + out << "\n"; + } + return out; +} diff --git a/dtool/src/cppparser/cppDeclaration.h b/dtool/src/cppparser/cppDeclaration.h index 1d65adacbf..db15f1ee2a 100644 --- a/dtool/src/cppparser/cppDeclaration.h +++ b/dtool/src/cppparser/cppDeclaration.h @@ -157,4 +157,7 @@ operator << (ostream &out, const CPPDeclaration &decl) { return out; } +ostream & +operator << (ostream &out, const CPPDeclaration::SubstDecl &decl); + #endif diff --git a/dtool/src/cppparser/cppEnumType.cxx b/dtool/src/cppparser/cppEnumType.cxx index 06fa1d0133..5a79d8aabb 100644 --- a/dtool/src/cppparser/cppEnumType.cxx +++ b/dtool/src/cppparser/cppEnumType.cxx @@ -34,6 +34,9 @@ CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope, _element_type(NULL), _last_value(NULL) { + if (ident != NULL) { + ident->_native_scope = current_scope; + } } //////////////////////////////////////////////////////////////////// @@ -49,6 +52,9 @@ CPPEnumType(CPPIdentifier *ident, CPPType *element_type, _element_type(element_type), _last_value(NULL) { + if (ident != NULL) { + ident->_native_scope = current_scope; + } } //////////////////////////////////////////////////////////////////// @@ -110,7 +116,6 @@ is_incomplete() const { return false; } - //////////////////////////////////////////////////////////////////// // Function: CPPEnumType::is_fully_specified // Access: Public, Virtual @@ -157,6 +162,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst, } CPPEnumType *rep = new CPPEnumType(*this); + if (_ident != NULL) { rep->_ident = _ident->substitute_decl(subst, current_scope, global_scope); @@ -176,7 +182,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst, ->as_instance(); if (elem_rep != _elements[i]) { - _elements[i] = elem_rep; + rep->_elements[i] = elem_rep; any_changed = true; } } diff --git a/dtool/src/cppparser/cppIdentifier.cxx b/dtool/src/cppparser/cppIdentifier.cxx index b0d3a3679e..5c44b45a5a 100644 --- a/dtool/src/cppparser/cppIdentifier.cxx +++ b/dtool/src/cppparser/cppIdentifier.cxx @@ -146,8 +146,10 @@ get_local_name(CPPScope *scope) const { if (scope == NULL || (_native_scope == NULL && _names.size() == 1)) { result = _names.back().get_name_with_templ(scope); + } else if (_names.front().empty()) { result = get_fully_scoped_name(); + } else { // Determine the scope of everything up until but not including the // last name. diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 28756dc41e..4ac0c6c4ea 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -2312,7 +2312,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, TypeIndex type_index, bool forced) { if (cpptype->get_simple_name().empty()) { // If the type has no name, forget it. We don't export anonymous - // types. + // structs. return; } diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index c6645baa6a..4a307d4af2 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1249,7 +1249,7 @@ def CompileIgate(woutd,wsrc,opts): cmd += ' -srcdir %s -I%s -Dvolatile -Dmutable' % (srcdir, srcdir) if (COMPILER=="MSVC"): - cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32' + cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32' if GetTargetArch() == 'x64': cmd += ' -DWIN64_VC -DWIN64 -D_WIN64' # NOTE: this 1600 value is the version number for VC2010.