From be4a4d74686fffb0a7e38cb4b1cad9653d2ba00f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 22 May 2013 23:05:26 -0700 Subject: Use fegetenv/fesetenv to backup and restore the FPU state --- Alc/helpers.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc/helpers.c') diff --git a/Alc/helpers.c b/Alc/helpers.c index a95e5ae3..25f85370 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -201,8 +201,8 @@ void al_free(void *ptr) void SetMixerFPUMode(FPUCtl *ctl) { -#if defined(HAVE_FESETROUND) - ctl->state = fegetround(); +#ifdef HAVE_FENV_H + fegetenv(STATIC_CAST(fenv_t, ctl)); #if defined(__GNUC__) && defined(HAVE_SSE) if((CPUCapFlags&CPU_CAP_SSE)) __asm__ __volatile__("stmxcsr %0" : "=m" (*&ctl->sse_state)); @@ -245,8 +245,8 @@ void SetMixerFPUMode(FPUCtl *ctl) void RestoreFPUMode(const FPUCtl *ctl) { -#if defined(HAVE_FESETROUND) - fesetround(ctl->state); +#ifdef HAVE_FENV_H + fesetenv(STATIC_CAST(fenv_t, ctl)); #if defined(__GNUC__) && defined(HAVE_SSE) if((CPUCapFlags&CPU_CAP_SSE)) __asm__ __volatile__("ldmxcsr %0" : : "m" (*&ctl->sse_state)); -- cgit v1.2.3