diff options
author | Chris Robinson <[email protected]> | 2020-03-20 15:01:45 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-03-20 15:01:45 -0700 |
commit | f56ef433d8bbf8709b559276bea79c6acb8167ef (patch) | |
tree | 9c826bbe5b187ce0c8374fb37db3bf13960297cd /alc/fpu_ctrl.h | |
parent | ad988958767f222625f2560cd628642c948cd736 (diff) |
Move the FPUCtl methods to its own source
Diffstat (limited to 'alc/fpu_ctrl.h')
-rw-r--r-- | alc/fpu_ctrl.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/alc/fpu_ctrl.h b/alc/fpu_ctrl.h new file mode 100644 index 00000000..e89bdc29 --- /dev/null +++ b/alc/fpu_ctrl.h @@ -0,0 +1,25 @@ +#ifndef FPU_CTRL_H +#define FPU_CTRL_H + +class FPUCtl { +#if defined(HAVE_SSE_INTRINSICS) || (defined(__GNUC__) && defined(HAVE_SSE)) + unsigned int sse_state{}; +#endif + bool in_mode{}; + +public: + FPUCtl(); + /* HACK: 32-bit targets for GCC seem to have a problem here with certain + * noexcept methods (which destructors are) causing an internal compiler + * error. No idea why it's these methods specifically, but this is needed + * to get it to compile. + */ + ~FPUCtl() noexcept(false) { leave(); } + + FPUCtl(const FPUCtl&) = delete; + FPUCtl& operator=(const FPUCtl&) = delete; + + void leave(); +}; + +#endif /* FPU_CTRL_H */ |