Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/ORBit2/ChangeLog,v
retrieving revision 1.423
diff -u -p -r1.423 ChangeLog
--- ChangeLog	2 Oct 2002 03:32:45 -0000	1.423
+++ ChangeLog	2 Oct 2002 07:33:14 -0000
@@ -1,3 +1,21 @@
+2002-10-02  James Henstridge  <james@daa.com.au>
+
+	* src/idl-compiler/orbit-idl-c-typecode.c (cbe_tc_generate): same
+	here.
+
+	* src/idl-compiler/orbit-idl-c-common.c (cc_output_class_id):
+	check for IMODULE symbol including file name.
+	(cc_output_itypes): and here.
+
+	* src/idl-compiler/orbit-idl-c-headers.c (ch_type_alloc_and_tc):
+	only define typecode struct as static if the header matches the
+	imodule we are compiling.
+	(ch_output_itypes): and here too.
+
+	* src/idl-compiler/orbit-idl-c-imodule.c
+	(orbit_idl_output_c_imodule): only define
+	ORBIT_IDL_C_IMODULE_filename.
+
 2002-10-02  Mark McLoughlin  <mark@skynet.ie>
 
 	* src/orb/orb-core/corba-typecode.c:
Index: src/idl-compiler/orbit-idl-c-common.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-common.c,v
retrieving revision 1.54
diff -u -p -r1.54 orbit-idl-c-common.c
--- src/idl-compiler/orbit-idl-c-common.c	30 Sep 2002 11:06:47 -0000	1.54
+++ src/idl-compiler/orbit-idl-c-common.c	2 Oct 2002 07:33:14 -0000
@@ -120,7 +120,7 @@ cc_output_class_id (IDL_tree       tree,
 	iface_id = IDL_ns_ident_to_qstring (
 		IDL_IDENT_TO_NS (IDL_INTERFACE (tree).ident), "_", 0);
 
-	fprintf (ci->fh, "\n#ifndef ORBIT_IDL_C_IMODULE\n");
+	fprintf (ci->fh, "\n#ifndef ORBIT_IDL_C_IMODULE_%s\n",ci->c_base_name);
 	fprintf (ci->fh, "CORBA_unsigned_long %s__classid = 0;\n", iface_id);
 	fprintf (ci->fh, "#endif\n");
 
@@ -405,7 +405,8 @@ cc_output_itypes (GSList *list, OIDL_C_I
 			cc_output_method_bits (m->data, id, ci);
 
 		if (i->methods) {
-			fprintf (of, "\n#ifdef ORBIT_IDL_C_IMODULE\n");
+			fprintf (of, "\n#ifdef ORBIT_IDL_C_IMODULE_%s\n",
+				 ci->c_base_name);
 			fprintf (of, "static\n");
 			fprintf (of, "#endif\n");
 
@@ -433,7 +434,8 @@ cc_output_itypes (GSList *list, OIDL_C_I
 
 		fprintf (of, "\"IDL:omg.org/CORBA/Object:1.0\"\n};");
 
-		fprintf (of, "\n#ifdef ORBIT_IDL_C_IMODULE\n");
+		fprintf (of, "\n#ifdef ORBIT_IDL_C_IMODULE_%s\n",
+			 ci->c_base_name);
 		fprintf (of, "static\n");
 		fprintf (of, "#endif\n");
 		fprintf (of, "ORBit_IInterface %s__iinterface = {\n", id);
Index: src/idl-compiler/orbit-idl-c-headers.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-headers.c,v
retrieving revision 1.66
diff -u -p -r1.66 orbit-idl-c-headers.c
--- src/idl-compiler/orbit-idl-c-headers.c	4 Sep 2002 06:43:02 -0000	1.66
+++ src/idl-compiler/orbit-idl-c-headers.c	2 Oct 2002 07:33:14 -0000
@@ -625,7 +625,7 @@ ch_type_alloc_and_tc(IDL_tree tree, OIDL
       orbit_cbe_id_define_hack(ci->fh, "TC_IMPL_TC", ctmp, ci->c_base_name);
   }
 
-  fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE\n");
+  fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE_%s\n", ci->c_base_name);
   fprintf (ci->fh, "static\n");
   fprintf (ci->fh, "#else\n");
   fprintf (ci->fh, "extern\n");
@@ -1027,7 +1027,8 @@ ch_output_itypes (IDL_tree tree, OIDL_C_
 
 		ch_output_itypes (IDL_INTERFACE(tree).body, ci);
       
-		fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE\n");
+		fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE_%s\n",
+			 ci->c_base_name);
 		fprintf (ci->fh, "static \n");
 		fprintf (ci->fh, "#else\n");
 		fprintf (ci->fh, "extern \n");
@@ -1039,7 +1040,8 @@ ch_output_itypes (IDL_tree tree, OIDL_C_
 		if (num_methods == 0)
 			fprintf (ci->fh, "#define %s__imethods (ORBit_IMethod*) NULL\n", id);
 		else {
-			fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE\n");
+			fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE_%s\n",
+				 ci->c_base_name);
 			fprintf (ci->fh, "static \n");
 			fprintf (ci->fh, "#else\n");
 			fprintf (ci->fh, "extern \n");
Index: src/idl-compiler/orbit-idl-c-imodule.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-imodule.c,v
retrieving revision 1.8
diff -u -p -r1.8 orbit-idl-c-imodule.c
--- src/idl-compiler/orbit-idl-c-imodule.c	4 Sep 2002 06:43:02 -0000	1.8
+++ src/idl-compiler/orbit-idl-c-imodule.c	2 Oct 2002 07:33:14 -0000
@@ -128,8 +128,7 @@ orbit_idl_output_c_imodule (IDL_tree    
 
 	fprintf (ci->fh, OIDL_C_WARNING);
 	fprintf (ci->fh, "#include <string.h>\n");
-	fprintf (ci->fh, "#define ORBIT_IDL_C_IMODULE\n");
-	fprintf (ci->fh, "#define %s_IMODLE\n\n", ci->c_base_name);
+	fprintf (ci->fh, "#define ORBIT_IDL_C_IMODULE_%s\n\n",ci->c_base_name);
 
 	fprintf (ci->fh, "#include \"%s-common.c\"\n\n", ci->base_name);
 
Index: src/idl-compiler/orbit-idl-c-typecode.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-typecode.c,v
retrieving revision 1.21
diff -u -p -r1.21 orbit-idl-c-typecode.c
--- src/idl-compiler/orbit-idl-c-typecode.c	8 Feb 2002 18:43:45 -0000	1.21
+++ src/idl-compiler/orbit-idl-c-typecode.c	2 Oct 2002 07:33:14 -0000
@@ -917,7 +917,8 @@ cbe_tc_generate (OIDL_C_Info  *ci,
 	if (!strncmp (tci->structname, "anon", 4))
 		fprintf (ci->fh, "static ");
 	else {
-		fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE\n");
+		fprintf (ci->fh, "#ifdef ORBIT_IDL_C_IMODULE_%s\n",
+			 ci->c_base_name);
 		fprintf (ci->fh, "static\n");
 		fprintf (ci->fh, "#endif\n");
 	}
