]> git.tdb.fi Git - ext/openal.git/blob - core/fpu_ctrl.h
Tweak some types to work around an MSVC compile error
[ext/openal.git] / core / fpu_ctrl.h
1 #ifndef CORE_FPU_CTRL_H
2 #define CORE_FPU_CTRL_H
3
4 class FPUCtl {
5 #if defined(HAVE_SSE_INTRINSICS) || (defined(__GNUC__) && defined(HAVE_SSE))
6     unsigned int sse_state{};
7 #endif
8     bool in_mode{};
9
10 public:
11     FPUCtl() noexcept { enter(); in_mode = true; }
12     ~FPUCtl() { if(in_mode) leave(); }
13
14     FPUCtl(const FPUCtl&) = delete;
15     FPUCtl& operator=(const FPUCtl&) = delete;
16
17     void enter() noexcept;
18     void leave() noexcept;
19 };
20
21 #endif /* CORE_FPU_CTRL_H */