]> git.mxchange.org Git - flightgear.git/commitdiff
Marc Frajola:
authorcurt <curt>
Tue, 28 Mar 2006 21:18:32 +0000 (21:18 +0000)
committercurt <curt>
Tue, 28 Mar 2006 21:18:32 +0000 (21:18 +0000)
Here is one patch that to make FlightGear run without floating point
exceptions on FreeBSD.  Apparently, if we do not ignore floating point
exceptions per this patch, there is some occasional condition where the
nvidia driver is involved in delivering spurious floating point exceptions
to the fgfs process, causing it to core-dump occasionally without the patch.

With only this patch, FlightGear will compile and run properly on
FreeBSD 6.X as long as the nvidia accelerated driver is installed,
modulo proper switches to the SimGear and FlightGear configure script
executions.

Again, kudos to your team for the great work on the big release
push; it is super to see things come together like this!

src/Main/bootstrap.cxx

index 1984ef27c5186f55a4410facd99522284da74ace..f6696081cc5fc46d59205e82ebc84a75b764b980 100644 (file)
@@ -28,6 +28,8 @@
 #if defined(__linux__) && defined(__i386__)
 #  include <fpu_control.h>
 #  include <signal.h>
+#elif defined(__FreeBSD__)
+#  include <signal.h>
 #endif
 
 #include <errno.h>
@@ -147,9 +149,12 @@ int main ( int argc, char **argv ) {
 
     _bootstrap_OSInit = 0;
 
-    // Enable floating-point exceptions for Linux/x86
 #if defined(__linux__) && defined(__i386__)
+    // Enable floating-point exceptions for Linux/x86
     initFPE();
+#elif defined(__FreeBSD__)
+    // Ignore floating-point exceptions on FreeBSD
+    signal(SIGFPE, SIG_IGN);
 #endif
 
 #if defined(sgi)