ports/devel/dyncall/files/patch-dyncallback_dyncall__thunk__ppc32__sysv.c
Piotr Kubaj b7c9e0e479 devel/dyncall: fix build on powerpc
cc  -O2 -pipe  -fPIC -fstack-protector-strong -fno-strict-aliasing  -I/wrkdirs/usr/ports/devel/dyncall/work/dyncall-1.4/./dyncallback/../dyncall -c dyncall_thunk.c -o dyncall_thunk.o
In file included from dyncall_thunk.c:38:
./dyncall_thunk_ppc32_sysv.c:28:28: warning: parameter 'x' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
                           ^
./dyncall_thunk_ppc32_sysv.c:28:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
                      ^
./dyncall_thunk_ppc32_sysv.c:29:28: warning: parameter 'x' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
static unsigned short lo16(x) { return ( (unsigned short)  ((unsigned int)x)        ); }
                           ^
./dyncall_thunk_ppc32_sysv.c:29:23: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static unsigned short lo16(x) { return ( (unsigned short)  ((unsigned int)x)        ); }
                      ^
./dyncall_thunk_ppc32_sysv.c:41:26: error: incompatible pointer to integer conversion passing 'DCThunk *' (aka 'struct DCThunk_ *') to parameter of type 'int' [-Wint-conversion]
  p->addr_self_hi = hi16(p);
                         ^
./dyncall_thunk_ppc32_sysv.c:43:26: error: incompatible pointer to integer conversion passing 'DCThunk *' (aka 'struct DCThunk_ *') to parameter of type 'int' [-Wint-conversion]
  p->addr_self_lo = lo16(p);
2023-10-11 20:26:31 +02:00

13 lines
602 B
C

--- dyncallback/dyncall_thunk_ppc32_sysv.c.orig 2023-10-10 15:09:47 UTC
+++ dyncallback/dyncall_thunk_ppc32_sysv.c
@@ -25,8 +25,8 @@
#include "dyncall_thunk.h"
-static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
-static unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
+static unsigned short hi16(DCThunk* x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
+static unsigned short lo16(DCThunk* x) { return ( (unsigned short) ((unsigned int)x) ); }
void dcbInitThunk(DCThunk* p, void (*entry)())
{