From 86e1d8f5974787e37b5b6d41dcafaa2e141c64be Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Tue, 4 May 1999 09:47:10 +0000 Subject: [PATCH] Fix to 5415. Don't complain about duplicate iids when linking, if the duplicate iids are zero (representing unresolved interfaces.) --- xpcom/libxpt/tools/xpt_link.c | 17 ++++++++++++++++- xpcom/typelib/xpt/tools/xpt_link.c | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/xpcom/libxpt/tools/xpt_link.c b/xpcom/libxpt/tools/xpt_link.c index 8461f0032b72..23376c73abc6 100644 --- a/xpcom/libxpt/tools/xpt_link.c +++ b/xpcom/libxpt/tools/xpt_link.c @@ -38,6 +38,7 @@ /* Forward declarations. */ typedef struct fixElement fixElement; static int compare_IDEs_by_IID(const void *ap, const void *bp); +static int compare_IDE_with_zero(const void *ap); static int compare_IDEs_by_name(const void *ap, const void *bp); static int compare_IDEs_by_name_space(const void *ap, const void *bp); static int compare_strings(const void *ap, const void *bp); @@ -381,7 +382,9 @@ main(int argc, char **argv) */ if (trueNumberOfInterfaces>1) { for (i=1; iiid, &ide2->iid); } +/* For detecting unresolved interfaces. */ +const nsID iid_zero = { 0x0, 0x0, 0x0, + { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }; + +static int +compare_IDE_with_zero(const void *ap) +{ + const XPTInterfaceDirectoryEntry *ide1 = ap; + + return compare_IIDs(&ide1->iid, &iid_zero); +} + static int compare_fixElements_by_IID(const void *ap, const void *bp) diff --git a/xpcom/typelib/xpt/tools/xpt_link.c b/xpcom/typelib/xpt/tools/xpt_link.c index 8461f0032b72..23376c73abc6 100644 --- a/xpcom/typelib/xpt/tools/xpt_link.c +++ b/xpcom/typelib/xpt/tools/xpt_link.c @@ -38,6 +38,7 @@ /* Forward declarations. */ typedef struct fixElement fixElement; static int compare_IDEs_by_IID(const void *ap, const void *bp); +static int compare_IDE_with_zero(const void *ap); static int compare_IDEs_by_name(const void *ap, const void *bp); static int compare_IDEs_by_name_space(const void *ap, const void *bp); static int compare_strings(const void *ap, const void *bp); @@ -381,7 +382,9 @@ main(int argc, char **argv) */ if (trueNumberOfInterfaces>1) { for (i=1; iiid, &ide2->iid); } +/* For detecting unresolved interfaces. */ +const nsID iid_zero = { 0x0, 0x0, 0x0, + { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }; + +static int +compare_IDE_with_zero(const void *ap) +{ + const XPTInterfaceDirectoryEntry *ide1 = ap; + + return compare_IIDs(&ide1->iid, &iid_zero); +} + static int compare_fixElements_by_IID(const void *ap, const void *bp)