[pygobject] Fix Python 2 build warning for module definitions
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix Python 2 build warning for module definitions
- Date: Tue, 14 Jan 2014 20:56:21 +0000 (UTC)
commit f2a79904ff4d60bff657bfbfd6a2ce8ab9307848
Author: Simon Feltman <sfeltman src gnome org>
Date: Tue Jan 14 12:54:42 2014 -0800
Fix Python 2 build warning for module definitions
Define PYGLIB_MODULE_ERROR_RETURN as NULL for both Python 2 and 3. This is
needed now that the function signature created with PYGLIB_MODULE_START is
consistent between the two versions.
gi/pyglib-python-compat.h | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gi/pyglib-python-compat.h b/gi/pyglib-python-compat.h
index 5365b20..40e79b4 100644
--- a/gi/pyglib-python-compat.h
+++ b/gi/pyglib-python-compat.h
@@ -30,9 +30,10 @@
PyCapsule_Import(##module##.##symbol##, FALSE)
+#define PYGLIB_MODULE_ERROR_RETURN NULL
+
/* Compilation on Python 2.x */
#if PY_VERSION_HEX < 0x03000000
-#define PYGLIB_MODULE_ERROR_RETURN
#define RO READONLY
@@ -113,8 +114,6 @@ PyTypeObject symbol = { \
#else
-#define PYGLIB_MODULE_ERROR_RETURN 0
-
#define PYGLIB_MODULE_START(symbol, modname) \
static struct PyModuleDef _##symbol##module = { \
PyModuleDef_HEAD_INIT, \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]