slackbuilds_ponce/academic/ViennaRNA/swig_4.2.0.txt
brobr a31f117413
academic/ViennaRNA: patch to compile against swig_4.2
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-07-28 07:47:01 +07:00

22 lines
552 B
Text

Description: rewriting code to build against swig 4.2.0
Author: Pierre Gruet <pgt@debian.org>
Forwarded: no
Last-Update: 2024-07-26
--- a/interfaces/inverse.i
+++ b/interfaces/inverse.i
@@ -78,7 +78,14 @@
#ifdef SWIGPYTHON
%typemap(varin) char * symbolset {
free(symbolset);
+
+#if SWIG_VERSION >= 0x040200
+ PyObject *pbytes = NULL;
+ symbolset = strdup(SWIG_PyUnicode_AsUTF8AndSize($input, NULL, &pbytes));
+ Py_XDECREF(pbytes);
+#else
symbolset = strdup(SWIG_Python_str_AsChar($input));
+#endif
}
%typemap(varout) char * symbolset {