aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-07-13 22:30:39 -0700
committerChris Robinson <[email protected]>2017-07-13 22:30:39 -0700
commita535169bbdd6766cbc6b53188065fbee6d4da1bc (patch)
tree26fd1cf5cf1cd7220026a817180dd1f7583d751b /OpenAL32/Include/alMain.h
parent22d77b87a3f103eeceec004cd9d053c17bf1b883 (diff)
Use macros to set and restore the mixer FPU mode
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 4081508e..ca97bff0 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -907,6 +907,17 @@ typedef struct {
} FPUCtl;
void SetMixerFPUMode(FPUCtl *ctl);
void RestoreFPUMode(const FPUCtl *ctl);
+#ifdef __GNUC__
+/* Use an alternate macro set with GCC to avoid accidental continue or break
+ * statements within the mixer mode.
+ */
+#define START_MIXER_MODE() __extension__({ FPUCtl _oldMode; SetMixerFPUMode(&_oldMode);
+#define END_MIXER_MODE() RestoreFPUMode(&_oldMode); })
+#else
+#define START_MIXER_MODE() do { FPUCtl _oldMode; SetMixerFPUMode(&_oldMode);
+#define END_MIXER_MODE() RestoreFPUMode(&_oldMode); } while(0)
+#endif
+#define LEAVE_MIXER_MODE() RestoreFPUMode(&_oldMode)
typedef struct ll_ringbuffer ll_ringbuffer_t;