Bug #306
closedGwenhywfar 5.11.1beta doesn't build in Mingw64
Description
In src/msgio/endpoint_msgio.c, endpoint_tcpc.c, endpoint_tcpd.c, and endpoint_multilayer.c:
error: conflicting types for '_freeData'; have 'void(void *, void *)'
64 | void _freeData(void *bp, void *p)
| ^~~~~~~
note: previous declaration of '_freeData' with type 'void(void *, void *)'
30 | static void GWENHYWFAR_CB _freeData(void *bp, void *p);
| ^~~~~~~
This is pretty easy to fix, just add GWENHYWFAR_CB to the definition of _freeData in each file.
But
C:/gcdev64/gnucash/stable/src/gwenhywfar-5.11.1beta/src/parser/tag16.c:26:10: fatal error: endian.h: No such file or directory
26 | #include <endian.h>
| ^~~~~~~~
is another matter. Mingw64 doesn't provide an endian.h, nor are the functions defined in it (htole32, htole64, le32toh, le64toh) supported.
That same file also uses strndup that's also not supported in Mingw64.
Updated by jralls@ceridwen.us almost 2 years ago
- Subject changed from Gwenhywfar 5.1.1beta doesn't build in Mingw64 to Gwenhywfar 5.11.1beta doesn't build in Mingw64
Updated by martin almost 2 years ago
- Status changed from New to Feedback
Hmm, "static void GWENHYWFAR_CB" already is in the forward declaration for _freeData in those files. So "GWENHYWFAR_CB" must also be added to function implementation later?
Updated by martin almost 2 years ago
regarding endian.h and the functions declared therein: this has now been replaced with "portable_endian.h" from https://gist.github.com/panzi/6856583 (public domain).
Updated by martin almost 2 years ago
Also, strndup() is now replaced with GWEN_Text_strndup().
Updated by jralls@ceridwen.us almost 2 years ago
Hmm, "static void GWENHYWFAR_CB" already is in the forward declaration for _freeData in those files. So "GWENHYWFAR_CB" must also be added to function implementation later?
Yes, because `__stdcall` changes the function signature so it must be part of both the declaration and definition. BTW the new aqgivve plugin in AQB has the same bug.
Updated by jralls@ceridwen.us over 1 year ago
Not quite, you missed aqgivve:
--- a/src/libs/plugins/backends/aqgivve/cardsdialog.c 2024-04-28 06:54:15.000000000 -0700
+++ b/src/libs/plugins/backends/aqgivve/cardsdialog.c 2024-06-22 14:32:30.624058500 -0700@ -57,7 +57,7 @
-void _freeData(void *bp, void *p)
+void GWENHYWFAR_CB _freeData(void *bp, void *p)
{
AG_CARDS_DIALOG *xdlg;
@ -88,7 +88,7 @
-int _dlgSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
+int GWENHYWFAR_CB _dlgSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
{
switch (t) {
case GWEN_DialogEvent_TypeInit :
--- a/src/libs/plugins/backends/aqgivve/provider_request.c 2024-03-19 14:48:38.000000000 -0700
+++ b/src/libs/plugins/backends/aqgivve/provider_request.c 2024-06-22 14:34:01.041737100 -0700@ -48,14 +48,14 @
-void _freeData(void *bp, void *p)
+void GWENHYWFAR_CB _freeData(void *bp, void *p)
{
free(p);
}
-int _cbInitSyncIo(GWEN_HTTP_SESSION *sess, GWEN_SYNCIO *sio)
+int GWENHYWFAR_CB _cbInitSyncIo(GWEN_HTTP_SESSION *sess, GWEN_SYNCIO *sio)
{
AG_HTTP_SESSION_HEADER *xsess;
--- a/src/libs/plugins/backends/aqgivve/userdialog.c 2024-01-07 11:29:43.000000000 -0800
+++ b/src/libs/plugins/backends/aqgivve/userdialog.c 2024-06-22 14:35:30.632390300 -0700@ -42,7 +42,7 @
-void _freeData(void *bp, void *p)
+void GWENHYWFAR_CB _freeData(void *bp, void *p)
{
}
@ -98,7 +98,7 @
-int _dlgSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
+int GWENHYWFAR_CB _dlgSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
{
switch (t) {
case GWEN_DialogEvent_TypeInit :