Created
July 14, 2015 19:24
-
-
Save kangaroo/2d862a3d8f9ce31bdc7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp | |
index 08d2a51..a53f0f8 100644 | |
--- a/src/jit/compiler.hpp | |
+++ b/src/jit/compiler.hpp | |
@@ -764,11 +764,27 @@ inline | |
inline | |
float getR4LittleEndian(const BYTE * ptr) | |
-{ return *(UNALIGNED float*)ptr; } | |
+{ | |
+#if FEATURE_UNALIGNED_FLOAT_ACCESS | |
+ return *(UNALIGNED float*)ptr; | |
+#else | |
+ float val; | |
+ memcpy(val, ptr, sizeof(float)); | |
+ return val; | |
+#endif | |
+} | |
inline | |
double getR8LittleEndian(const BYTE * ptr) | |
-{ return *(UNALIGNED double*)ptr; } | |
+{ | |
+#if FEATURE_UNALIGNED_FLOAT_ACCESS | |
+ return *(UNALIGNED double*)ptr; | |
+#else | |
+ double val; | |
+ memcpy (&val, ptr, sizeof(double)); | |
+ return val; | |
+#endif | |
+} | |
/***************************************************************************** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment