pygobject r881 - in trunk: . gobject



Author: johan
Date: Sun Jul 27 09:03:06 2008
New Revision: 881
URL: http://svn.gnome.org/viewvc/pygobject?rev=881&view=rev

Log:
2008-07-27  Johan Dahlin  <johan gnome org>

    * gobject/Makefile.am:
    * gobject/gobjectmodule.c (PYGLIB_MODULE_START):
    * gobject/pygobject-private.h:
    Use glib macros to define the module, update export regexp.



Modified:
   trunk/ChangeLog
   trunk/gobject/Makefile.am
   trunk/gobject/gobjectmodule.c
   trunk/gobject/pygobject-private.h

Modified: trunk/gobject/Makefile.am
==============================================================================
--- trunk/gobject/Makefile.am	(original)
+++ trunk/gobject/Makefile.am	Sun Jul 27 09:03:06 2008
@@ -37,7 +37,7 @@
 	$(GLIB_CFLAGS) \
 	 -DPY_SSIZE_T_CLEAN \
 	-I$(top_srcdir)/glib
-_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gobject
+_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject"
 _gobject_la_LIBADD = \
 	$(GLIB_LIBS) \
 	$(FFI_LIBS) \

Modified: trunk/gobject/gobjectmodule.c
==============================================================================
--- trunk/gobject/gobjectmodule.c	(original)
+++ trunk/gobject/gobjectmodule.c	Sun Jul 27 09:03:06 2008
@@ -1949,7 +1949,7 @@
     return Py_None;
 }
 
-static PyMethodDef pygobject_functions[] = {
+static PyMethodDef _gobject_functions[] = {
     { "type_name", pyg_type_name, METH_VARARGS },
     { "type_from_name", pyg_type_from_name, METH_VARARGS },
     { "type_parent", pyg_type_parent, METH_VARARGS },
@@ -2552,19 +2552,16 @@
 }
 
 
-DL_EXPORT(void)
-init_gobject(void)
+PYGLIB_MODULE_START(_gobject, "gobject._gobject")
 {
-    PyObject *m, *d;
-    
-    m = Py_InitModule("gobject._gobject", pygobject_functions);
-    d = PyModule_GetDict(m);
+    PyObject *d;
 
     g_type_init();
     pyglib_init();
 
+    d = PyModule_GetDict(module);
     pygobject_register_api(d);
-    pygobject_register_constants(m);
+    pygobject_register_constants(module);
     pygobject_register_features(d);
     pygobject_register_version_tuples(d);
     pygobject_register_warnings(d);
@@ -2581,3 +2578,4 @@
     _pyg_signal_accumulator_true_handled_func = \
         PyDict_GetItemString(d, "signal_accumulator_true_handled");
 }
+PYGLIB_MODULE_END

Modified: trunk/gobject/pygobject-private.h
==============================================================================
--- trunk/gobject/pygobject-private.h	(original)
+++ trunk/gobject/pygobject-private.h	Sun Jul 27 09:03:06 2008
@@ -8,6 +8,8 @@
 #define _INSIDE_PYGOBJECT_
 #include "pygobject.h"
 
+#include "pyglib-python-compat.h"
+
 /* Python 2.3 does not define Py_CLEAR */
 #ifndef Py_CLEAR
 #define Py_CLEAR(op)                \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]