]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
prowizard: avoid duplicate htonl and _cdecl definitions
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 2 Jun 2026 23:59:00 +0000 (16:59 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Thu, 4 Jun 2026 05:33:24 +0000 (22:33 -0700)
Some hosts provide htonl as a macro through system headers. Avoid
redeclaring the Pro-Wizard helper in that case.

Also provide a no-op _cdecl definition for non-Windows builds so shared
Pro-Wizard declarations compile without Windows calling-convention
macros.

prowizard/include/extern.h
prowizard/include/globals.h
prowizard/misc/misc.c

index 5f424f6321b35344ce8520cbc4d1665c8e196cdc..83f894871c07ddae39a3c226c1865cd20e50c5ca 100644 (file)
@@ -332,7 +332,9 @@ extern short test_smps ( long, long, long, Uchar, Uchar );
 extern long  PWGetFileSize ( char * );
 extern FILE * PW_fopen ( char *, char * );
 extern void fillPTKtable ( Uchar[37][2] );
+#ifndef htonl
 extern unsigned int htonl(unsigned int);
+#endif
 
 /* globals */
 /* Some say it's badly coding when using Globals ... sure it is, now what's the solution ? */
index a32710ba5fe4fbe98d087a2871b42e03c2f81927..11c978af6b385c071b2bd125f3ad13f8d827c388 100644 (file)
@@ -26,6 +26,10 @@ __inline Ulong htonlx (Ulong v)
 {
     return (v >> 24) | ((v >> 8) & 0xff00) | (v << 24) | ((v << 8) & 0xff0000);
 }
+#else
+#ifndef _cdecl
+#define _cdecl
+#endif
 #endif
 
 #define _KNOWN_FORMATS      135
index 8d71d6fe797a8521f7b8375dfb8c36e8018b5f19..1ade02dd4684e1cf88f8c07ec5de2e6c02b4c4f8 100644 (file)
@@ -508,7 +508,9 @@ void fillPTKtable (Uchar poss[37][2])
   return;
 }
 
+#ifndef htonl
 unsigned int htonl(unsigned int v)
 {
        return ((v >> 24) & 0x000000ff) | ((v >> 8) & 0x0000ff00) | ((v << 8) & 0x00ff0000) | ((v << 24) & 0xff000000);
 }
+#endif