diff -ur a/jamvm-1.5.4/src/os/linux/i386/init.c b/jamvm-1.5.4/src/os/linux/i386/init.c --- a/jamvm-1.5.4/src/os/linux/i386/init.c 2009-12-31 19:40:48.000000000 -0100 +++ b/jamvm-1.5.4/src/os/linux/i386/init.c 2015-01-31 22:57:09.558345144 -0100 @@ -19,18 +19,18 @@ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include /* Change floating point precision to double (64-bit) from * the extended (80-bit) Linux default. */ void setDoublePrecision() { - fpu_control_t cw; + fenv_t fenv; - _FPU_GETCW(cw); - cw &= ~_FPU_EXTENDED; - cw |= _FPU_DOUBLE; - _FPU_SETCW(cw); + fegetenv(&fenv); + fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */ + fenv.__control_word |= 0x200; /* _FPU_DOUBLE */ + fesetenv(&fenv); } void initialisePlatform() { diff -ur a/jamvm-1.5.4/src/os/linux/x86_64/init.c b/jamvm-1.5.4/src/os/linux/x86_64/init.c --- a/jamvm-1.5.4/src/os/linux/x86_64/init.c 2009-12-31 19:40:48.000000000 -0100 +++ b/jamvm-1.5.4/src/os/linux/x86_64/init.c 2015-01-31 22:57:03.257423916 -0100 @@ -19,9 +19,7 @@ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef __linux__ -#include -#endif +#include /* Change the x87 FPU precision to double (64-bit) from the extended (80-bit) Linux default. Note, unlike on i386, my testcases pass @@ -30,14 +28,12 @@ */ void setDoublePrecision() { -#ifdef __linux__ - fpu_control_t cw; + fenv_t fenv; - _FPU_GETCW(cw); - cw &= ~_FPU_EXTENDED; - cw |= _FPU_DOUBLE; - _FPU_SETCW(cw); -#endif + fegetenv(&fenv); + fenv.__control_word &= ~0x300; /*_FPU_EXTENDED */ + fenv.__control_word |= 0x200; /*_FPU_DOUBLE */ + fesetenv(&fenv); } void initialisePlatform() {