pyuno/source/module/pyuno.cxx          |    3 +++
 pyuno/source/module/pyuno_callable.cxx |    3 +++
 pyuno/source/module/pyuno_iterator.cxx |    6 ++++++
 pyuno/source/module/pyuno_runtime.cxx  |    3 +++
 pyuno/source/module/pyuno_struct.cxx   |    3 +++
 5 files changed, 18 insertions(+)

New commits:
commit 122d7f8deec80d05552ab98ce349d748c953446f
Author:     Justin Luth <[email protected]>
AuthorDate: Wed Mar 13 08:38:40 2024 -0400
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue May 21 09:15:01 2024 +0200

    allow build with python 3.12.0: initialize new tp_watched
    
    This fixes the build failure after I updated Ubuntu 24.04 (alpha),
    which upgraded python 3.11.7 to python 3.12.0, causing the error:
    
    libreoffice/pyuno/source/module/pyuno_callable.cxx:249:1:
    error: missing initializer for member ‘_typeobject::tp_watched’
    [-Werror=missing-field-initializers]
    ...
    
    I gleaned this information from a July 2023 commit for
    https://github.com/xbmc/xbmc/issues/23503
    
    tp_watched was added in upstream commit python/cpython@82ccbf6
    
https://github.com/python/cpython/commit/82ccbf69a842db25d8117f1c41b47aa5b4ed96ab
    
    This change first appeared in Python v3.12.0a1
    
    Change-Id: If82ff1eb47d66d2669d90d6e00e0feff3c55b5ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164775
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    Reviewed-by: Stephan Bergmann <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167834
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index cc4858279949..e8fa6c89d991 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -1667,6 +1667,9 @@ static PyTypeObject PyUNOType =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };
diff --git a/pyuno/source/module/pyuno_callable.cxx 
b/pyuno/source/module/pyuno_callable.cxx
index f22de316b7de..8f19fc8eb654 100644
--- a/pyuno/source/module/pyuno_callable.cxx
+++ b/pyuno/source/module/pyuno_callable.cxx
@@ -244,6 +244,9 @@ static PyTypeObject PyUNO_callable_Type =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };
diff --git a/pyuno/source/module/pyuno_iterator.cxx 
b/pyuno/source/module/pyuno_iterator.cxx
index 134f318a1017..2fc70a32fcff 100644
--- a/pyuno/source/module/pyuno_iterator.cxx
+++ b/pyuno/source/module/pyuno_iterator.cxx
@@ -177,6 +177,9 @@ static PyTypeObject PyUNO_iterator_Type =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };
@@ -323,6 +326,9 @@ static PyTypeObject PyUNO_list_iterator_Type =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };
diff --git a/pyuno/source/module/pyuno_runtime.cxx 
b/pyuno/source/module/pyuno_runtime.cxx
index 7f3eb7a6e95f..02f02c2f6679 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -138,6 +138,9 @@ static PyTypeObject RuntimeImpl_Type =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };
diff --git a/pyuno/source/module/pyuno_struct.cxx 
b/pyuno/source/module/pyuno_struct.cxx
index c8fd7e987905..364f2776011a 100644
--- a/pyuno/source/module/pyuno_struct.cxx
+++ b/pyuno/source/module/pyuno_struct.cxx
@@ -354,6 +354,9 @@ static PyTypeObject PyUNOStructType =
 #pragma clang diagnostic pop
 #endif
 #endif
+#if PY_VERSION_HEX >= 0x030C00A1
+    , 0 // tp_watched
+#endif
 #endif
 #endif
 };

Reply via email to