summaryrefslogtreecommitdiff
path: root/dev-python/pyopengl-accelerate/files/pyopengl-accelerate-3.1.8-gcc-14.patch
blob: 56f976288316addf35149e1f4b9704e6aaaf1834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From fbe0fab7947788039cb4fbc9a5a1ea65a0c0e15b Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 5 Jan 2024 08:48:12 +0100
Subject: [PATCH 1/2] accelerate: Fix type of PyArray_FillWithScalar

The first argument is of type PyArrayObject, not PyObject.
--- a/accelerate/src/numpy_formathandler.pyx
+++ b/accelerate/src/numpy_formathandler.pyx
@@ -22,7 +22,7 @@ cdef extern from "numpy/arrayobject.h":
     int PyArray_ISCARRAY_RO( np.ndarray instance )
     cdef np.ndarray PyArray_Zeros(int nd, np.npy_intp* dims, np.dtype, int fortran)
     cdef np.ndarray PyArray_EnsureArray(object)
-    cdef int PyArray_FillWithScalar(object, object)
+    cdef int PyArray_FillWithScalar(np.ndarray, object)
     cdef void import_array()
     cdef void* PyArray_DATA( np.ndarray )
     cdef int PyArray_NDIM( np.ndarray )

From f62dd58a5437c628d3ff3e626d4507811ef2127b Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 5 Jan 2024 08:48:43 +0100
Subject: [PATCH 2/2] accelerate: Use recommended way to integrate NumPy with
 Cython

This approach follows
<https://cython.readthedocs.io/en/latest/src/tutorial/numpy.html#adding-types>.
--- a/accelerate/src/numpy_formathandler.pyx
+++ b/accelerate/src/numpy_formathandler.pyx
@@ -23,7 +23,6 @@ cdef extern from "numpy/arrayobject.h":
     cdef np.ndarray PyArray_Zeros(int nd, np.npy_intp* dims, np.dtype, int fortran)
     cdef np.ndarray PyArray_EnsureArray(object)
     cdef int PyArray_FillWithScalar(np.ndarray, object)
-    cdef void import_array()
     cdef void* PyArray_DATA( np.ndarray )
     cdef int PyArray_NDIM( np.ndarray )
     cdef int *PyArray_DIMS( np.ndarray )
@@ -227,4 +226,4 @@ cdef class NumpyHandler(FormatHandler):
 
 # Cython numpy tutorial neglects to mention this AFAICS
 # get segfaults without it
-import_array()
+np.import_array()