Fix build errors with Clang. Patches from Pkgsrc.

Binary differs so bump REVISION as well.

OK espie@
This commit is contained in:
fcambus 2017-04-28 07:37:00 +00:00
parent 47d9834f69
commit a0fe3b3203
7 changed files with 89 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.35 2017/04/10 11:45:28 sthen Exp $
# $OpenBSD: Makefile,v 1.36 2017/04/28 07:37:00 fcambus Exp $
COMMENT= ARM/M88k/MIPS/PowerPC/SuperH machines emulator
DISTNAME = gxemul-0.6.0.1
CATEGORIES= emulators
REVISION = 0
REVISION = 1
HOMEPAGE= http://gxemul.sourceforge.net/

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_components_cpu_CPUDyntransComponent_cc,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/components/cpu/CPUDyntransComponent.cc.orig Sun Aug 17 10:45:14 2014
+++ src/components/cpu/CPUDyntransComponent.cc Mon Apr 24 15:28:54 2017
@@ -194,7 +194,7 @@ void CPUDyntransComponent::DyntransClearICPage(struct
// Fill the page with "to be translated" entries, which when executed
// will read the instruction from memory, attempt to translate it, and
// then execute it.
- void (*f)(CPUDyntransComponent*, DyntransIC*) = GetDyntransToBeTranslated();
+ DyntransIC_t f = GetDyntransToBeTranslated();
for (int i=0; i<m_dyntransICentriesPerPage; ++i)
icpage[i].f = f;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_components_cpu_M88K_CPUComponent_cc,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/components/cpu/M88K_CPUComponent.cc.orig Sun Aug 17 10:45:14 2014
+++ src/components/cpu/M88K_CPUComponent.cc Mon Apr 24 15:28:54 2017
@@ -337,7 +337,7 @@ int M88K_CPUComponent::GetDyntransICshift() const
}
-void (*M88K_CPUComponent::GetDyntransToBeTranslated())(CPUDyntransComponent*, DyntransIC*) const
+DyntransIC_t M88K_CPUComponent::GetDyntransToBeTranslated() const
{
return instr_ToBeTranslated;
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_components_cpu_MIPS_CPUComponent_cc,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/components/cpu/MIPS_CPUComponent.cc.orig Sun Aug 17 10:45:14 2014
+++ src/components/cpu/MIPS_CPUComponent.cc Mon Apr 24 15:28:54 2017
@@ -327,7 +327,7 @@ int MIPS_CPUComponent::GetDyntransICshift() const
}
-void (*MIPS_CPUComponent::GetDyntransToBeTranslated())(CPUDyntransComponent*, DyntransIC*) const
+DyntransIC_t MIPS_CPUComponent::GetDyntransToBeTranslated() const
{
bool mips16 = m_pc & 1? true : false;
return mips16? instr_ToBeTranslated_MIPS16 : instr_ToBeTranslated;

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_include_components_CPUDyntransComponent_h,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/include/components/CPUDyntransComponent.h.orig Sun Aug 17 10:45:13 2014
+++ src/include/components/CPUDyntransComponent.h Mon Apr 24 15:28:54 2017
@@ -47,9 +47,13 @@ class CPUDyntransComponent;
* f points to a function to be executed.
* arg[] contains arguments, such as pointers to registers, or immediate values.
*/
+class CPUDyntransComponent;
+struct DyntransIC;
+typedef void (*DyntransIC_t)(class CPUDyntransComponent*, struct DyntransIC*);
+
struct DyntransIC
{
- void (*f)(CPUDyntransComponent*, DyntransIC*);
+ DyntransIC_t f;
union {
void* p;
@@ -105,7 +109,7 @@ class CPUDyntransComponent (public)
protected:
// Implemented by specific CPU families:
virtual int GetDyntransICshift() const = 0;
- virtual void (*GetDyntransToBeTranslated())(CPUDyntransComponent* cpu, DyntransIC* ic) const = 0;
+ virtual DyntransIC_t GetDyntransToBeTranslated() const = 0;
void DyntransToBeTranslatedBegin(struct DyntransIC*);
bool DyntransReadInstruction(uint16_t& iword);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_include_components_M88K_CPUComponent_h,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/include/components/M88K_CPUComponent.h.orig Sun Aug 17 10:45:13 2014
+++ src/include/components/M88K_CPUComponent.h Mon Apr 24 15:28:54 2017
@@ -377,7 +377,7 @@ class M88K_CPUComponent (protected)
virtual bool FunctionTraceReturnImpl(int64_t& retval) { retval = m_r[M88K_RETURN_VALUE_REG]; return true; }
virtual int GetDyntransICshift() const;
- virtual void (*GetDyntransToBeTranslated())(CPUDyntransComponent*, DyntransIC*) const;
+ virtual DyntransIC_t GetDyntransToBeTranslated() const ;
virtual void ShowRegisters(GXemul* gxemul, const vector<string>& arguments) const;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_include_components_MIPS_CPUComponent_h,v 1.1 2017/04/28 07:37:00 fcambus Exp $
--- src/include/components/MIPS_CPUComponent.h.orig Sun Aug 17 10:45:13 2014
+++ src/include/components/MIPS_CPUComponent.h Mon Apr 24 15:28:54 2017
@@ -196,7 +196,7 @@ class MIPS_CPUComponent (protected)
virtual bool FunctionTraceReturnImpl(int64_t& retval);
virtual int GetDyntransICshift() const;
- virtual void (*GetDyntransToBeTranslated())(CPUDyntransComponent*, DyntransIC*) const;
+ virtual DyntransIC_t GetDyntransToBeTranslated() const;
virtual void ShowRegisters(GXemul* gxemul, const vector<string>& arguments) const;