aports/community/tinyfugue/python-3.14.patch
mio 3c17194e16 community/tinyfugue: fix build on 32-bit arches
Fix incompatible pointer types error on 32-bit arches.

```
tfpython.c: In function 'pyvar_to_tfvar':
tfpython.c:213:76: error: passing argument 3 of 'PyBytes_AsStringAndSize' from incompatible pointer type [-Wincompatible-pointer-types]
  213 |         if( PyBytes_Check( pRc ) && ( PyBytes_AsStringAndSize( pRc, &cstr, &len ) != -1 ) ) {
      |                                                                            ^~~~
      |                                                                            |
      |                                                                            long int *
In file included from /usr/include/python3.14/Python.h:89:
/usr/include/python3.14/bytesobject.h:54:17: note: expected 'Py_ssize_t *' {aka 'int *'} but argument is of type 'long int *'
   54 |     Py_ssize_t *len     /* pointer to length variable or NULL */
      |     ~~~~~~~~~~~~^~~
tfpython.c:219:55: error: passing argument 3 of 'PyBytes_AsStringAndSize' from incompatible pointer type [-Wincompatible-pointer-types]
  219 |                 PyBytes_AsStringAndSize( temp, &cstr, &len );
      |                                                       ^~~~
      |                                                       |
      |                                                       long int *
/usr/include/python3.14/bytesobject.h:54:17: note: expected 'Py_ssize_t *' {aka 'int *'} but argument is of type 'long int *'
   54 |     Py_ssize_t *len     /* pointer to length variable or NULL */
      |     ~~~~~~~~~~~~^~~
```

Also realign `gnu-source.patch` to remove a `'_GNU_SOURCE' redefined` warning.
2026-03-29 03:20:36 +00:00

13 lines
368 B
Diff

diff -rupN a/src/tfpython.c b/src/tfpython.c
--- a/src/tfpython.c 2025-10-27 16:50:44.000000000 +0000
+++ b/src/tfpython.c 2026-03-29 02:42:54.570000000 +0000
@@ -201,7 +201,7 @@ static struct Value* pyvar_to_tfvar( PyO
{
struct Value *rc;
char *cstr;
- long int len; // Py_ssize_t len;
+ Py_ssize_t len;
// can be null if exception was thrown
if( !pRc ) {