? visibility.h
Index: atkmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/atkmodule.c,v
retrieving revision 1.4
diff -u -r1.4 atkmodule.c
--- atkmodule.c	6 Jul 2006 07:26:54 -0000	1.4
+++ atkmodule.c	13 Jul 2006 19:04:53 -0000
@@ -24,6 +24,8 @@
 #include "config.h"
 #endif
 
+#include "visibility.h"
+
 /* include this first, before NO_IMPORT_PYGOBJECT is defined */
 #include <pygobject.h>
 
@@ -31,7 +33,7 @@
 void pyatk_add_constants(PyObject *module, const gchar *strip_prefix);
 void _pyatk_register_boxed_types(void);	
 
-extern PyMethodDef pyatk_functions[];
+extern PyMethodDef HIDDEN pyatk_functions[];
 
 DL_EXPORT(void)
 initatk(void)
Index: codegen/codegen.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/codegen/codegen.py,v
retrieving revision 1.114
diff -u -r1.114 codegen.py
--- codegen/codegen.py	5 Jul 2006 16:03:24 -0000	1.114
+++ codegen/codegen.py	13 Jul 2006 19:04:54 -0000
@@ -10,6 +10,8 @@
 import override
 import reversewrapper
 
+visibility = '__attribute__ ((visibility ("hidden")))'
+
 class Coverage(object):
     def __init__(self, name):
         self.name = name
@@ -91,7 +93,7 @@
 
 class Wrapper:
     type_tmpl = (
-        'PyTypeObject Py%(typename)s_Type = {\n'
+        'PyTypeObject ' + visibility +  ' Py%(typename)s_Type = {\n'
         '    PyObject_HEAD_INIT(NULL)\n'
         '    0,                                 /* ob_size */\n'
         '    "%(classname)s",                   /* tp_name */\n'
@@ -774,7 +776,7 @@
         # write the PyMethodDef structure
         functions.append('    { NULL, NULL, 0, NULL }\n')
 
-        self.fp.write('const PyMethodDef ' + prefix + '_functions[] = {\n')
+        self.fp.write('const PyMethodDef ' +  visibility + prefix + '_functions[] = {\n')
         self.fp.write(string.join(functions, ''))
         self.fp.write('};\n\n')
 
@@ -1230,13 +1232,14 @@
         self.fp.write('\n\n')
 
     def write_type_declarations(self):
+        #todo use 'static' if used only in one file
         self.fp.write('/* ---------- forward type declarations ---------- */\n')
         for obj in self.parser.boxes:
-            self.fp.write('PyTypeObject Py' + obj.c_name + '_Type;\n')
+            self.fp.write('PyTypeObject ' + visibility + ' Py' + obj.c_name + '_Type;\n')
         for obj in self.parser.objects:
-            self.fp.write('PyTypeObject Py' + obj.c_name + '_Type;\n')
+            self.fp.write('PyTypeObject ' + visibility + ' Py' + obj.c_name + '_Type;\n')
         for interface in self.parser.interfaces:
-            self.fp.write('PyTypeObject Py' + interface.c_name + '_Type;\n')
+            self.fp.write('PyTypeObject ' + visibility + ' Py' + interface.c_name + '_Type;\n')
         self.fp.write('\n')
 
     def write_body(self):
