[pygobject] make cairo module compile in py3k
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] make cairo module compile in py3k
- Date: Wed, 25 Aug 2010 09:40:00 +0000 (UTC)
commit 286dcd0c6455961d818ac7f05f80f82435abc1dc
Author: John (J5) Palmieri <johnp redhat com>
Date: Tue Aug 17 15:43:42 2010 -0400
make cairo module compile in py3k
https://bugzilla.gnome.org/show_bug.cgi?id=615872
gi/Makefile.am | 2 +-
gi/pygi-foreign-cairo.c | 17 +++++++----------
2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/gi/Makefile.am b/gi/Makefile.am
index 90cbf7d..2fbb4ac 100644
--- a/gi/Makefile.am
+++ b/gi/Makefile.am
@@ -62,7 +62,7 @@ _gi_cairo_la_CFLAGS = \
_gi_cairo_la_LDFLAGS = \
-module \
-avoid-version \
- -export-symbols-regex init_gi_cairo
+ -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
_gi_cairo_la_LIBADD = \
$(GI_LIBS) \
$(PYCAIRO_LIBS)
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
index 56c9321..8320173 100644
--- a/gi/pygi-foreign-cairo.c
+++ b/gi/pygi-foreign-cairo.c
@@ -27,6 +27,8 @@ Pycairo_CAPI_t *Pycairo_CAPI;
#include "pygi-foreign.h"
+#include <pyglib-python-compat.h>
+
PyObject *
cairo_context_to_arg (PyObject *value,
GITypeInfo *type_info,
@@ -103,19 +105,13 @@ cairo_surface_release (GIBaseInfo *base_info,
Py_RETURN_NONE;
}
-PyMODINIT_FUNC
-init_gi_cairo (void)
-{
- PyObject *m;
-
- m = Py_InitModule ("_gi_cairo", NULL);
- if (m == NULL) {
- return;
- }
+static PyMethodDef _gi_cairo_functions[] = {};
+PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
+{
Pycairo_IMPORT;
if (Pycairo_CAPI == NULL)
- return;
+ return 0;
pygi_register_foreign_struct ("cairo",
"Context",
@@ -129,3 +125,4 @@ init_gi_cairo (void)
cairo_surface_from_arg,
cairo_surface_release);
}
+PYGLIB_MODULE_END;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]