From 162b86c6d9430b027499bfbb43767cca05ff4b6e Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Feb 2018 19:33:18 +0100 Subject: [PATCH] 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. --- dtool/src/interrogatedb/interrogateType.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogatedb/interrogateType.cxx b/dtool/src/interrogatedb/interrogateType.cxx index a977ff987a..a6d6e45487 100644 --- a/dtool/src/interrogatedb/interrogateType.cxx +++ b/dtool/src/interrogatedb/interrogateType.cxx @@ -112,14 +112,16 @@ operator = (const InterrogateType ©) { /** * 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:: merge_with(const InterrogateType &other) { // The only thing we care about copying from the non-fully-defined type // 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. _flags |= (other._flags & F_global);