Date: Thu, 1 Aug 2019 19:17:57 +0000 (UTC) From: Piotr Kubaj <pkubaj@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r507824 - in head/emulators/mame: . files Message-ID: <201908011917.x71JHvcH013323@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pkubaj Date: Thu Aug 1 19:17:57 2019 New Revision: 507824 URL: https://svnweb.freebsd.org/changeset/ports/507824 Log: 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 Added: head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl (contents, props changed) head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl (contents, props changed) head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h (contents, props changed) head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp (contents, props changed) Modified: head/emulators/mame/Makefile Modified: head/emulators/mame/Makefile ============================================================================== --- head/emulators/mame/Makefile Thu Aug 1 19:12:17 2019 (r507823) +++ head/emulators/mame/Makefile Thu Aug 1 19:17:57 2019 (r507824) @@ -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 Added: head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_endian.inl Thu Aug 1 19:17:57 2019 (r507824) @@ -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); Added: head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_inline_readerwriter.inl Thu Aug 1 19:17:57 2019 (r507824) @@ -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>() ); Added: head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/mame/files/patch-3rdparty_bx_include_bx_readerwriter.h Thu Aug 1 19:17:57 2019 (r507824) @@ -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" + Added: head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/mame/files/patch-3rdparty_bx_tests_readerwriter__test.cpp Thu Aug 1 19:17:57 2019 (r507824) @@ -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); ++}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908011917.x71JHvcH013323>