Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/ORBit2/ChangeLog,v
retrieving revision 1.422
diff -u -p -r1.422 ChangeLog
--- ChangeLog	30 Sep 2002 16:08:44 -0000	1.422
+++ ChangeLog	2 Oct 2002 03:12:55 -0000
@@ -1,3 +1,14 @@
+2002-10-02  James Henstridge  <james@daa.com.au>
+
+	* 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): correct the definition of module
+	dependent define.
+
 2002-09-30  ERDI Gergo  <cactus@cactus.rulez.org>
 
 	* src/idl-compiler/orbit-idl-c-stubs.c (cs_output_stub): Cast EPV
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 03:12:55 -0000
@@ -625,7 +625,8 @@ 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, "#if defined(ORBIT_IDL_C_IMODULE) && defined(%s_IMODULE)\n",
+	   ci->c_base_name);
   fprintf (ci->fh, "static\n");
   fprintf (ci->fh, "#else\n");
   fprintf (ci->fh, "extern\n");
@@ -1027,7 +1028,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, "#if defined(ORBIT_IDL_C_IMODULE) && defined(%s_IMODULE)\n",
+			 ci->c_base_name);
 		fprintf (ci->fh, "static \n");
 		fprintf (ci->fh, "#else\n");
 		fprintf (ci->fh, "extern \n");
@@ -1039,7 +1041,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, "#if defined(ORBIT_IDL_C_IMODULE) && defined(%s_IMODULE)\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 03:12:56 -0000
@@ -129,7 +129,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 %s_IMODULE\n\n", ci->c_base_name);
 
 	fprintf (ci->fh, "#include \"%s-common.c\"\n\n", ci->base_name);
 
