45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
diff -Nur gnucash-5.10.orig/bindings/python/time64.i gnucash-5.10/bindings/python/time64.i
|
|
--- gnucash-5.10.orig/bindings/python/time64.i 2024-09-20 17:42:41.000000000 -0400
|
|
+++ gnucash-5.10/bindings/python/time64.i 2025-01-07 23:50:07.172692786 -0500
|
|
@@ -132,6 +132,12 @@
|
|
$1 = &secs;
|
|
}
|
|
|
|
+#ifdef HAVE_SWIG_APPENDOUTPUT
|
|
+#define SWIG_APPENDOUTPUT(res, func) SWIG_AppendOutput(res, func)
|
|
+#else
|
|
+#define SWIG_APPENDOUTPUT(res, func) SWIG_Python_AppendOutput(res, func)
|
|
+#endif
|
|
+
|
|
%typemap(argout) time64 *date (time64 secs) {
|
|
PyDateTime_IMPORT;
|
|
PyObject *tp;
|
|
@@ -148,9 +154,8 @@
|
|
tp = PyDateTime_FromDateAndTime(t.tm_year + 1900, t.tm_mon + 1,
|
|
t.tm_mday, t.tm_hour, t.tm_min,
|
|
t.tm_sec, 0);
|
|
-
|
|
- $result = SWIG_Python_AppendOutput($result, tp);
|
|
- } else $result = SWIG_Python_AppendOutput($result, Py_None);
|
|
+ $result = SWIG_APPENDOUTPUT($result, tp);
|
|
+ } else $result = SWIG_APPENDOUTPUT($result, Py_None);
|
|
}
|
|
|
|
%apply time64 *date { time64 *last_date };
|
|
diff -Nur gnucash-5.10.orig/common/cmake_modules/GncAddSwigCommand.cmake gnucash-5.10/common/cmake_modules/GncAddSwigCommand.cmake
|
|
--- gnucash-5.10.orig/common/cmake_modules/GncAddSwigCommand.cmake 2024-09-24 16:36:01.000000000 -0400
|
|
+++ gnucash-5.10/common/cmake_modules/GncAddSwigCommand.cmake 2025-01-07 23:52:35.257990201 -0500
|
|
@@ -86,6 +86,12 @@
|
|
)
|
|
|
|
set (PYTHON_SWIG_FLAGS ${DEFAULT_SWIG_PYTHON_FLAGS})
|
|
+
|
|
+ if (SWIG_VERSION VERSION_GREATER_EQUAL "4.3.0")
|
|
+ list(APPEND PYTHON_SWIG_FLAGS
|
|
+ -DHAVE_SWIG_APPENDOUTPUT=1)
|
|
+ endif()
|
|
+
|
|
foreach (dir ${DEFAULT_SWIG_PYTHON_C_INCLUDES} ${_include_dirs})
|
|
list (APPEND PYTHON_SWIG_FLAGS "-I${dir}")
|
|
endforeach (dir)
|