forked from pool/perl-Inline-Python
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Inline-Python?expand=0&rev=2
97 lines
2.5 KiB
Diff
97 lines
2.5 KiB
Diff
---
|
|
Python.xs | 2 +-
|
|
myPython.h | 23 +++++++++++++++++++++++
|
|
perlmodule.c | 2 +-
|
|
py2pl.c | 2 +-
|
|
util.c | 3 ++-
|
|
5 files changed, 28 insertions(+), 4 deletions(-)
|
|
|
|
Index: Inline-Python-0.35/perlmodule.c
|
|
===================================================================
|
|
--- Inline-Python-0.35.orig/perlmodule.c
|
|
+++ Inline-Python-0.35/perlmodule.c
|
|
@@ -6,7 +6,7 @@ extern "C" {
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
-#include "Python.h"
|
|
+#include "myPython.h"
|
|
#include "perlmodule.h"
|
|
#include "py2pl.h"
|
|
#include "util.h"
|
|
Index: Inline-Python-0.35/util.c
|
|
===================================================================
|
|
--- Inline-Python-0.35.orig/util.c
|
|
+++ Inline-Python-0.35/util.c
|
|
@@ -5,7 +5,7 @@ extern "C" {
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
-#include "Python.h"
|
|
+#include "myPython.h"
|
|
#include "util.h"
|
|
#ifdef __cplusplus
|
|
}
|
|
@@ -25,6 +25,7 @@ int free_inline_py_obj(pTHX_ SV* obj, MA
|
|
else {
|
|
croak("ERROR: tried to free a non-Python object. Aborting.");
|
|
}
|
|
+ return 0;
|
|
}
|
|
|
|
PyObject * get_perl_pkg_subs(PyObject *package) {
|
|
Index: Inline-Python-0.35/myPython.h
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ Inline-Python-0.35/myPython.h
|
|
@@ -0,0 +1,23 @@
|
|
+// avoid redefined warnings.
|
|
+#ifdef _XOPEN_SOURCE
|
|
+# define __MY__XOPEN_SOURCE _XOPEN_SOURCE
|
|
+# undef _XOPEN_SOURCE
|
|
+#endif
|
|
+#ifdef _POSIX_C_SOURCE
|
|
+# define __MY__POSIX_C_SOURCE _POSIX_C_SOURCE
|
|
+# undef _POSIX_C_SOURCE
|
|
+#endif
|
|
+
|
|
+#include "Python.h"
|
|
+
|
|
+#ifndef _XOPEN_SOURCE
|
|
+# warn "_XOPEN_SOURCE not defined in /usr/include/python2.6/Python.h, using earlier definition"
|
|
+# define _XOPEN_SOURCE __MY__XOPEN_SOURCE
|
|
+#endif
|
|
+#ifndef _POSIX_C_SOURCE
|
|
+# warn "_POSIX_C_SOURCE not defined in /usr/include/python2.6/Python.h, using earlier definition"
|
|
+# define _POSIX_C_SOURCE __MY__POSIX_C_SOURCE
|
|
+#endif
|
|
+
|
|
+#undef __MY__XOPEN_SOURCE
|
|
+#undef __MY__POSIX_C_SOURCE
|
|
Index: Inline-Python-0.35/Python.xs
|
|
===================================================================
|
|
--- Inline-Python-0.35.orig/Python.xs
|
|
+++ Inline-Python-0.35/Python.xs
|
|
@@ -4,7 +4,7 @@
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
-#include "Python.h"
|
|
+#include "myPython.h"
|
|
#include "py2pl.h"
|
|
#include "util.h"
|
|
|
|
Index: Inline-Python-0.35/py2pl.c
|
|
===================================================================
|
|
--- Inline-Python-0.35.orig/py2pl.c
|
|
+++ Inline-Python-0.35/py2pl.c
|
|
@@ -2,7 +2,7 @@
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
-#include "Python.h"
|
|
+#include "myPython.h"
|
|
#include "py2pl.h"
|
|
#include "util.h"
|
|
|