From 4086988d6fee6f2c068e9ceebe0108e165555766 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Thu, 5 Dec 2024 08:56:31 +0100 Subject: [PATCH] test --- cmake/DaemonFlags.cmake | 2 +- src/engine/framework/System.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake index 94f1f32ebf..712c7f4289 100644 --- a/cmake/DaemonFlags.cmake +++ b/cmake/DaemonFlags.cmake @@ -153,7 +153,7 @@ option(USE_FLOAT_EXCEPTIONS "Use floating point exceptions" OFF) option(USE_FAST_MATH "Use fast math" ON) if (USE_FLOAT_EXCEPTIONS) - add_definitions(-DDAEMON_USE_FLOAT_EXCEPTIONS) + add_definitions( -DDAEMON_USE_FLOAT_EXCEPTIONS ) endif() if (MSVC) diff --git a/src/engine/framework/System.cpp b/src/engine/framework/System.cpp index b3b6e47230..ac5bf1d4dd 100644 --- a/src/engine/framework/System.cpp +++ b/src/engine/framework/System.cpp @@ -300,7 +300,6 @@ static void CloseSingletonSocket() static void SetFloatingPointExceptions() { - // Must be done after Sys::Init() to read cvars from command line. #if defined(DAEMON_USE_FLOAT_EXCEPTIONS_AVAILABLE) #if defined(__USE_GNU) || defined(__APPLE__) int exceptions = 0; @@ -359,6 +358,13 @@ static void SetFloatingPointExceptions() _controlfp_s(¤t, exceptions, _MCW_EM); #endif #endif +// TODO: remove it. +#if 1 +const float x = -1.0f; +const float f = 0.0f; +printf("%f\n", sqrt(x)); +printf(" %f\n", 1/f); +#endif } // Common code for fatal and non-fatal exit