emulators/mame: fix build on powerpc64
powerpc64 requires the same Makefile fix as amd64. Additionally, https://github.com/bkaradzic/bx/commit/684f7ec5d6a8e0d9c396bdd2dfc1f19244800557 is necessary. Approved by: linimon (mentor) Differential Revision: https://reviews.freebsd.org/D21055
This commit is contained in:
@@ -11,8 +11,8 @@ COMMENT= Multi Arcade Machine Emulator
|
||||
|
||||
LICENSE= GPLv2
|
||||
|
||||
ONLY_FOR_ARCHS= amd64 i386
|
||||
ONLY_FOR_ARCHS_REASON= not yet ported to any arch other than x86
|
||||
ONLY_FOR_ARCHS= amd64 i386 powerpc64
|
||||
ONLY_FOR_ARCHS_REASON= not yet ported to any arch other than x86 and powerpc64
|
||||
|
||||
LIB_DEPENDS= libFLAC.so:audio/flac \
|
||||
libexpat.so:textproc/expat2 \
|
||||
@@ -58,7 +58,7 @@ DEBUG_MAKE_ENV= DEBUG=1
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${ARCH} == amd64
|
||||
.if ${ARCH} == amd64 || ${ARCH} == powerpc64
|
||||
MAKE_ARGS+= PTR64=1
|
||||
EMULATOR= ${MSUBTARGET}64
|
||||
.else
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--- 3rdparty/bx/include/bx/inline/endian.inl.orig 2019-04-24 05:00:38 UTC
|
||||
+++ 3rdparty/bx/include/bx/inline/endian.inl
|
||||
@@ -46,7 +46,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template <typename Ty>
|
||||
- inline Ty toLittleEndian(const Ty _in)
|
||||
+ inline Ty toLittleEndian(Ty _in)
|
||||
{
|
||||
#if BX_CPU_ENDIAN_BIG
|
||||
return endianSwap(_in);
|
||||
@@ -56,7 +56,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template <typename Ty>
|
||||
- inline Ty toBigEndian(const Ty _in)
|
||||
+ inline Ty toBigEndian(Ty _in)
|
||||
{
|
||||
#if BX_CPU_ENDIAN_LITTLE
|
||||
return endianSwap(_in);
|
||||
@@ -66,7 +66,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template <typename Ty>
|
||||
- inline Ty toHostEndian(const Ty _in, bool _fromLittleEndian)
|
||||
+ inline Ty toHostEndian(Ty _in, bool _fromLittleEndian)
|
||||
{
|
||||
#if BX_CPU_ENDIAN_LITTLE
|
||||
return _fromLittleEndian ? _in : endianSwap(_in);
|
||||
@@ -0,0 +1,76 @@
|
||||
--- 3rdparty/bx/include/bx/inline/readerwriter.inl.orig 2019-04-24 05:00:38 UTC
|
||||
+++ 3rdparty/bx/include/bx/inline/readerwriter.inl
|
||||
@@ -273,7 +273,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
- int32_t read(ReaderI* _reader, Ty& _value, Error* _err)
|
||||
+ inline int32_t read(ReaderI* _reader, Ty& _value, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -281,7 +281,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
- int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err)
|
||||
+ inline int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -329,7 +329,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
- int32_t write(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
+ inline int32_t write(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -337,7 +337,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
- int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
+ inline int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -346,8 +346,14 @@ namespace bx
|
||||
return result;
|
||||
}
|
||||
|
||||
+ template<>
|
||||
+ inline int32_t writeLE(WriterI* _writer, const float& _value, Error* _err)
|
||||
+ {
|
||||
+ return writeLE(_writer, floatToBits(_value), _err);
|
||||
+ }
|
||||
+
|
||||
template<typename Ty>
|
||||
- int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
+ inline int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -356,6 +362,12 @@ namespace bx
|
||||
return result;
|
||||
}
|
||||
|
||||
+ template<>
|
||||
+ inline int32_t writeBE(WriterI* _writer, const float& _value, Error* _err)
|
||||
+ {
|
||||
+ return writeBE(_writer, floatToBits(_value), _err);
|
||||
+ }
|
||||
+
|
||||
inline int64_t skip(SeekerI* _seeker, int64_t _offset)
|
||||
{
|
||||
return _seeker->seek(_offset, Whence::Current);
|
||||
@@ -392,7 +404,7 @@ namespace bx
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
- int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err)
|
||||
+ inline int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err)
|
||||
{
|
||||
BX_ERROR_SCOPE(_err);
|
||||
BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
|
||||
@@ -0,0 +1,10 @@
|
||||
--- 3rdparty/bx/include/bx/readerwriter.h.orig 2019-04-24 05:00:38 UTC
|
||||
+++ 3rdparty/bx/include/bx/readerwriter.h
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "endian.h"
|
||||
#include "error.h"
|
||||
#include "filepath.h"
|
||||
+#include "math.h"
|
||||
#include "string.h"
|
||||
#include "uint32_t.h"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
--- 3rdparty/bx/tests/readerwriter_test.cpp.orig 2019-07-24 09:54:15 UTC
|
||||
+++ 3rdparty/bx/tests/readerwriter_test.cpp
|
||||
@@ -0,0 +1,31 @@
|
||||
+/*
|
||||
+ * Copyright 2010-2019 Branimir Karadzic. All rights reserved.
|
||||
+ * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
|
||||
+ */
|
||||
+
|
||||
+#include "test.h"
|
||||
+#include <bx/readerwriter.h>
|
||||
+
|
||||
+TEST_CASE("writeLE", "")
|
||||
+{
|
||||
+ bx::SizerWriter writer;
|
||||
+
|
||||
+ bx::Error err;
|
||||
+
|
||||
+ int32_t total = bx::writeLE(&writer, 1.0f, &err);
|
||||
+
|
||||
+ REQUIRE(err.isOk() );
|
||||
+ REQUIRE(total == 4);
|
||||
+}
|
||||
+
|
||||
+TEST_CASE("writeBE", "")
|
||||
+{
|
||||
+ bx::SizerWriter writer;
|
||||
+
|
||||
+ bx::Error err;
|
||||
+
|
||||
+ int32_t total = bx::writeBE(&writer, 1.0f, &err);
|
||||
+
|
||||
+ REQUIRE(err.isOk() );
|
||||
+ REQUIRE(total == 4);
|
||||
+}
|
||||
Reference in New Issue
Block a user