[Python-checkins] CVS: python/dist/src/Modules fpectlmodule.c,2.10,2.11

Guido van Rossum python-dev@python.org
Tue, 19 Sep 2000 06:35:43 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv21478

Modified Files:
	fpectlmodule.c 
Log Message:
Randall Hopper: Add fpectl functionality patch for FreeBSD.


Index: fpectlmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/fpectlmodule.c,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -r2.10 -r2.11
*** fpectlmodule.c	2000/07/23 21:18:09	2.10
--- fpectlmodule.c	2000/09/19 13:35:40	2.11
***************
*** 69,72 ****
--- 69,76 ----
  #include <signal.h>
  
+ #if defined(__FreeBSD__)
+ #  include <ieeefp.h>
+ #endif
+ 
  #ifndef WANT_SIGFPE_HANDLER
  /* Define locally if they are not defined in Python.  This gives only
***************
*** 179,182 ****
--- 183,192 ----
      signal(SIGFPE, handler);
  
+ /*-- FreeBSD ----------------------------------------------------------------*/
+ #elif defined(__FreeBSD__)
+     fpresetsticky( fpgetsticky() );
+     fpsetmask( FP_X_INV | FP_X_DZ | FP_X_OFL );
+     signal( SIGFPE, handler );
+ 
  /*-- Linux ----------------------------------------------------------------*/
  #elif defined(linux)
***************
*** 213,217 ****
--- 223,232 ----
  static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args)
  {
+ #ifdef __FreeBSD__
+     fpresetsticky( fpgetsticky() );
+     fpsetmask( 0 );
+ #else
      fputs("Operation not implemented\n", stderr);
+ #endif
      Py_INCREF (Py_None);
      return Py_None;