Re: [hatari-devel] MIDI support for Windows & OSX (with PortMidi)

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Donnerstag, 9. November 2017 00:14:07 CET Nicolas Pomarède wrote:
> Even if it didn't work, do you get the same error messages from
> compilation ?

Yes.

>I think it's an old legacy part from the "old" UAE code, I'm not sure WinUAE 
uses this.

Thats possible. I think Aranym is still using this. Not necessary maybe on 
newer systems, but unfortunately those macros were not always available, or 
had different names in the past, causing all kind of grieve also in aranym.

>Maybe you can try to add some "#ifndef bswap_32" and "#ifndef bswap_16" 
>at lines 563/564 before really doing the 2 defines ? (to keep those from 
>byteswap.h in your case)

I used attached patch, and that fixes it. Hope it does not break anything.


--- src/cpu/sysdeps.h.orig	2017-11-09 00:19:23.520902731 +0100
+++ src/cpu/sysdeps.h	2017-11-09 00:20:14.956901612 +0100
@@ -556,12 +556,20 @@
 /* Else, if using SDL, try SDL's endian functions. */
 # ifdef USE_SDL
 #  include <SDL_endian.h>
-#  define bswap_16(x) SDL_Swap16(x)
-#  define bswap_32(x) SDL_Swap32(x)
+#  ifndef bswap_16
+#    define bswap_16(x) SDL_Swap16(x)
+#  endif
+#  ifndef bswap_32
+#    define bswap_32(x) SDL_Swap32(x)
+#  endif
 # else
 /* Otherwise, we'll roll our own. */
-#  define bswap_16(x) (((x) >> 8) | (((x) & 0xFF) << 8))
-#  define bswap_32(x) (((x) << 24) | (((x) << 8) & 0x00FF0000) | (((x) >> 8) & 0x0000FF00) | ((x) >> 24))
+#  ifndef bswap_16
+#    define bswap_16(x) (((x) >> 8) | (((x) & 0xFF) << 8))
+#  endif
+#  ifndef bswap_32
+#    define bswap_32(x) (((x) << 24) | (((x) << 8) & 0x00FF0000) | (((x) >> 8) & 0x0000FF00) | ((x) >> 24))
+#  endif
 # endif
 #endif
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/