gwnavruntime/math/floatingpointexceptionsetter.h Source File

floatingpointexceptionsetter.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
10 #include <float.h>
11 
12 namespace Kaim
13 {
14 
17 {
19 public:
20 
21 #if (defined(KY_OS_WINDOWSPC) || defined(KY_OS_XBOXONE)) && defined(KY_CONFIG_DEBUG_OR_DEV)
22  enum
23  {
24  None = 0,
25  Normal = _EM_OVERFLOW | _EM_ZERODIVIDE | _EM_INVALID,
26  All = _EM_INEXACT | _EM_UNDERFLOW | _EM_OVERFLOW | _EM_ZERODIVIDE | _EM_INVALID
27  };
28 #else
29  enum { None = 0, Normal = 0, All = 0 };
30 #endif
31 
32  static unsigned int GetEnableFlags();
33 
34  // Passing a bit to enableFlags will enable the corresponding exception.
35  // This is different from the confusing _controlfp_s() or _controlfp() that disable the exception when bit is 1.
36  static void SetEnableFlags(unsigned int enableFlags);
37 
39  FloatingPointExceptionSetter(unsigned int enableFlags);
41 
42 private:
43  unsigned int m_previousEnableFlags;
44 };
45 
46 
47 }
48 
Activate floating point exceptions. Implemented on WINDOWS and XBOXONE only.
Definition: floatingpointexceptionsetter.h:16
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17