aboutsummaryrefslogtreecommitdiffstats
path: root/core/fpu_ctrl.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-12-31 18:20:05 -0800
committerChris Robinson <[email protected]>2020-12-31 18:23:59 -0800
commit87a862199d6e64e8be9909657288ffa66b1c40fb (patch)
treee9c567fb024024463588a4c9082192cace899498 /core/fpu_ctrl.h
parent20ef8bf390541339f068676f9d14061fe2f5e115 (diff)
Make FPUCtl methods noexcept
Diffstat (limited to 'core/fpu_ctrl.h')
-rw-r--r--core/fpu_ctrl.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/fpu_ctrl.h b/core/fpu_ctrl.h
index 20bd2772..e6dc1fb2 100644
--- a/core/fpu_ctrl.h
+++ b/core/fpu_ctrl.h
@@ -8,18 +8,14 @@ class FPUCtl {
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() noexcept { enter(); in_mode = true; };
+ ~FPUCtl() { if(in_mode) leave(); }
FPUCtl(const FPUCtl&) = delete;
FPUCtl& operator=(const FPUCtl&) = delete;
- void leave();
+ void enter() noexcept;
+ void leave() noexcept;
};
#endif /* CORE_FPU_CTRL_H */