MonkeysAudio: fix build on ppc* and big endian

This commit is contained in:
q66 2020-04-10 20:34:07 +02:00
parent 260527c23a
commit 08db80e50c
4 changed files with 136 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From cbace147456d6ccc1921f62582a791b340b8a88d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 10 Apr 2020 20:31:00 +0200
Subject: [PATCH] fix build on big endian
---
Source/MACLib/MD5.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git Source/MACLib/MD5.cpp Source/MACLib/MD5.cpp
index c122fb5..89079b2 100644
--- Source/MACLib/MD5.cpp
+++ Source/MACLib/MD5.cpp
@@ -35,11 +35,11 @@ CopyToLittleEndian ( uint32_t* dst,
const uint8_t* src,
size_t length )
{
- for ( ; length--; src += 4; dst++ ) {
- *dst = (( (uint32_t) src [3] ) << 24) |
- (( (uint32_t) src [2] ) << 16) |
- (( (uint32_t) src [1] ) << 8) |
- (( (uint32_t) src [0] ) << 0);
+ for ( ; length--; src += 4 ) {
+ *dst++ = (( (uint32_t) src [3] ) << 24) |
+ (( (uint32_t) src [2] ) << 16) |
+ (( (uint32_t) src [1] ) << 8) |
+ (( (uint32_t) src [0] ) << 0);
}

View File

@ -0,0 +1,66 @@
From ba9bb2bccdf67a8a202c578fcf09a3aa6dda4c63 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 10 Apr 2020 20:22:17 +0200
Subject: [PATCH] MonkeysAudio: patch out bad endian definitions breaking
builds
---
Shared/All.h | 8 +-------
Source/Shared/All.h | 8 +-------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git Shared/All.h Shared/All.h
index 6dfb669..cc9a988 100644
--- Shared/All.h
+++ Shared/All.h
@@ -45,6 +45,7 @@ Global includes
#include <sys/types.h>
#include <sys/stat.h>
#include <wchar.h>
+ #include <endian.h>
#include "NoWindows.h"
#endif
#define ape_max(a,b) (((a) > (b)) ? (a) : (b))
@@ -246,13 +247,6 @@ Global defines
#define APE_FILENAME_SLASH '/'
#endif
-/*****************************************************************************************
-Byte order
-*****************************************************************************************/
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
-#define __BYTE_ORDER __LITTLE_ENDIAN
-
/*****************************************************************************************
Macros
*****************************************************************************************/
diff --git Source/Shared/All.h Source/Shared/All.h
index 6dfb669..cc9a988 100644
--- Source/Shared/All.h
+++ Source/Shared/All.h
@@ -45,6 +45,7 @@ Global includes
#include <sys/types.h>
#include <sys/stat.h>
#include <wchar.h>
+ #include <endian.h>
#include "NoWindows.h"
#endif
#define ape_max(a,b) (((a) > (b)) ? (a) : (b))
@@ -246,13 +247,6 @@ Global defines
#define APE_FILENAME_SLASH '/'
#endif
-/*****************************************************************************************
-Byte order
-*****************************************************************************************/
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
-#define __BYTE_ORDER __LITTLE_ENDIAN
-
/*****************************************************************************************
Macros
*****************************************************************************************/
--
2.25.1

View File

@ -0,0 +1,39 @@
From 9b8a97da0946d01f60798a5636062141a61a92ac Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 10 Apr 2020 20:26:23 +0200
Subject: [PATCH] add powerpc64 in 64-bit platforms to unbreak build
---
Shared/All.h | 2 +-
Source/Shared/All.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git Shared/All.h Shared/All.h
index cc9a988..615e3d1 100644
--- Shared/All.h
+++ Shared/All.h
@@ -123,7 +123,7 @@ Global compiler settings (useful for porting)
#endif
#endif
-#if __x86_64__ || __aarch64__
+#if __x86_64__ || __aarch64__ || __powerpc64__
#ifndef PLATFORM_x64
#define PLATFORM_x64
#endif
diff --git Source/Shared/All.h Source/Shared/All.h
index cc9a988..615e3d1 100644
--- Source/Shared/All.h
+++ Source/Shared/All.h
@@ -123,7 +123,7 @@ Global compiler settings (useful for porting)
#endif
#endif
-#if __x86_64__ || __aarch64__
+#if __x86_64__ || __aarch64__ || __powerpc64__
#ifndef PLATFORM_x64
#define PLATFORM_x64
#endif
--
2.25.1

View File

@ -1,7 +1,7 @@
# Template file for 'MonkeysAudio'
pkgname=MonkeysAudio
version=5.28
revision=1
revision=2
create_wrksrc=yes
build_style="gnu-makefile"
depends="libMAC>=${version}_${revision}"