From 4e4736c3c747c2d7d817d4df410e3d3938e115fd Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Thu, 27 May 1999 11:02:05 +0000 Subject: [PATCH] Fix to 6880. xpt_link now prints an informative error message when it encounters duplicate interface names with different iids. --- xpcom/typelib/xpt/tools/xpt_link.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xpcom/typelib/xpt/tools/xpt_link.c b/xpcom/typelib/xpt/tools/xpt_link.c index 222026e720f7..c0341c5bd179 100644 --- a/xpcom/typelib/xpt/tools/xpt_link.c +++ b/xpcom/typelib/xpt/tools/xpt_link.c @@ -294,7 +294,8 @@ main(int argc, char **argv) trueNumberOfInterfaces--; } else { if (!IDE_array[i].interface_descriptor || - (compare_IIDs(&IDE_array[i-1].iid, &IDE_array[i].iid) == 0)) { + (compare_IIDs(&IDE_array[i-1].iid, &IDE_array[i].iid) == 0)) + { /* Shrink the IDE_array to delete the duplicate interface. */ if (!shrink_IDE_array(IDE_array, @@ -315,9 +316,21 @@ main(int argc, char **argv) * this loop. */ trueNumberOfInterfaces--; + } else { + /* Found interfaces with duplicate names but different + * iids! */ + char *ns = IDE_array[i].name_space; + fprintf(stderr, + "ERROR: found duplicate definitions of interface " + "%s%s%s with iids \n", + ns ? ns : "", ns ? "::" : "", IDE_array[i].name); + print_IID(&IDE_array[i].iid, stderr); + fprintf(stderr, " and "); + print_IID(&IDE_array[i-1].iid, stderr); + fprintf(stderr, "\n"); + return 1; } } - } else { /* Only increment if there was no name_space::name collision. */