git: b7c9e0e4796c - main - devel/dyncall: fix build on powerpc

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 11 Oct 2023 18:27:11 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b7c9e0e4796ce3341fa3df7f508095e1705cc6e9

commit b7c9e0e4796ce3341fa3df7f508095e1705cc6e9
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-10-10 15:17:38 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-10-11 18:26:31 +0000

    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);
---
 .../files/patch-dyncallback_dyncall__thunk__ppc32__sysv.c   | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/devel/dyncall/files/patch-dyncallback_dyncall__thunk__ppc32__sysv.c b/devel/dyncall/files/patch-dyncallback_dyncall__thunk__ppc32__sysv.c
new file mode 100644
index 000000000000..88c56ccb381b
--- /dev/null
+++ b/devel/dyncall/files/patch-dyncallback_dyncall__thunk__ppc32__sysv.c
@@ -0,0 +1,13 @@
+--- 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)())
+ {