diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-27 09:03:06 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-27 09:03:06 +0000 |
commit | 826e4b1a42873c8fadb3a7f98abf244c666a413b (patch) | |
tree | 4513a6c8308e449409ee947af891bbd1706f46c6 /gobject | |
parent | 28cc14391b52dcbef2e148dcc985b2803623234d (diff) | |
download | pygobject-826e4b1a42873c8fadb3a7f98abf244c666a413b.tar.gz pygobject-826e4b1a42873c8fadb3a7f98abf244c666a413b.tar.xz pygobject-826e4b1a42873c8fadb3a7f98abf244c666a413b.zip |
Use glib macros to define the module, update export regexp.
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.
svn path=/trunk/; revision=881
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/Makefile.am | 2 | ||||
-rw-r--r-- | gobject/gobjectmodule.c | 14 | ||||
-rw-r--r-- | gobject/pygobject-private.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/gobject/Makefile.am b/gobject/Makefile.am index e7c5291..41dcf6d 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -37,7 +37,7 @@ _gobject_la_CFLAGS = \ $(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) \ diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 0867c56..77cccb4 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1949,7 +1949,7 @@ pyg__install_metaclass(PyObject *dummy, PyTypeObject *metaclass) 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 @@ pygobject_register_warnings(PyObject *d) } -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 @@ init_gobject(void) _pyg_signal_accumulator_true_handled_func = \ PyDict_GetItemString(d, "signal_accumulator_true_handled"); } +PYGLIB_MODULE_END diff --git a/gobject/pygobject-private.h b/gobject/pygobject-private.h index 9810cf4..aebe4c5 100644 --- a/gobject/pygobject-private.h +++ b/gobject/pygobject-private.h @@ -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) \ |