Browse Source

interrogatedb: fix library name setting for typedefs

Typedefs are evidently always considered "fully defined", so we need to add another condition to the database merging code to prefer the type that is marked "global" when merging two types.
rdb 7 years ago
parent
commit
162b86c6d9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      dtool/src/interrogatedb/interrogateType.cxx

+ 4 - 2
dtool/src/interrogatedb/interrogateType.cxx

@@ -112,14 +112,16 @@ operator = (const InterrogateType &copy) {
 
 
 /**
 /**
  * Combines type with the other similar definition.  If one type is "fully
  * Combines type with the other similar definition.  If one type is "fully
- * defined" and the other one isn't, the fully-defined type wins.
+ * defined" and the other one isn't, the fully-defined type wins.  If both
+ * types are fully defined, whichever type is marked "global" wins.
  */
  */
 void InterrogateType::
 void InterrogateType::
 merge_with(const InterrogateType &other) {
 merge_with(const InterrogateType &other) {
   // The only thing we care about copying from the non-fully-defined type
   // The only thing we care about copying from the non-fully-defined type
   // right now is the global flag.
   // right now is the global flag.
 
 
-  if (is_fully_defined()) {
+  if (is_fully_defined() &&
+      (!other.is_fully_defined() || (other._flags & F_global) == 0)) {
     // We win.
     // We win.
     _flags |= (other._flags & F_global);
     _flags |= (other._flags & F_global);