From: Erik H. <eh...@us...> - 2016-05-20 12:35:01
|
Update of /cvsroot/jsbsim/JSBSim/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32386 Modified Files: JSBSim.cpp Log Message: Detect floating point exceptions in standalone mode for easier debugging Index: JSBSim.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/JSBSim.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -r1.87 -r1.88 *** JSBSim.cpp 24 Nov 2015 13:06:24 -0000 1.87 --- JSBSim.cpp 20 May 2016 12:34:58 -0000 1.88 *************** *** 50,53 **** --- 50,59 ---- #endif + #if defined(_MSC_VER) + # include <float.h> + #elif defined(__GNUC__) && !defined(sgi) + # include <fenv.h> + #endif + #if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__) # define WIN32_LEAN_AND_MEAN *************** *** 278,281 **** --- 284,295 ---- int main(int argc, char* argv[]) { + #if defined(_MSC_VER) + _clearfp(); + _controlfp(_controlfp(0, 0) & ~(_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW), + _MCW_EM); + #elif defined(__GNUC__) && !defined(sgi) + feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT); + #endif + try { real_main(argc, argv); |