aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mame/fix-ppc64le-float.patch
blob: 99a31eda2c568bf114aff2afb8f53895184df9d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
--- a/3rdparty/bx/include/bx/inline/endian.inl
+++ b/3rdparty/bx/include/bx/inline/endian.inl
@@ -46,7 +46,7 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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);
--- a/3rdparty/bx/include/bx/inline/readerwriter.inl
+++ b/3rdparty/bx/include/bx/inline/readerwriter.inl
@@ -273,7 +273,7 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 	}
 
 	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 @@
 		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 @@
 		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 @@
 	}
 
 	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>() );
--- a/3rdparty/bx/include/bx/readerwriter.h
+++ b/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"