[Python-checkins] python/dist/src/Include pyport.h,2.56,2.57

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 28 Dec 2002 13:56:09 -0800


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv11412/python/Include

Modified Files:
	pyport.h 
Log Message:
Apparently FreeBSD enables some HW floating-point exceptions by default.
This can cause core dumps when Python runs.  Python relies on the 754-
(and C99-) mandated default "non-stop" mode for FP exceptions.  This
patch from Ben Laurie disables at least one FP exception on FreeBSD at
Python startup time.


Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.56
retrieving revision 2.57
diff -C2 -d -r2.56 -r2.57
*** pyport.h	19 Dec 2002 15:24:11 -0000	2.56
--- pyport.h	28 Dec 2002 21:56:07 -0000	2.57
***************
*** 256,263 ****
--- 256,268 ----
   *	  in non-overflow cases.
   *    X is evaluated more than once.
+  * Some platforms have better way to spell this, so expect some #ifdef'ery.
   */
+ #ifdef __FreeBSD__
+ #define Py_OVERFLOWED(X) isinf(X)
+ #else
  #define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE ||    \
  					 (X) == Py_HUGE_VAL || \
  					 (X) == -Py_HUGE_VAL))
+ #endif
  
  /* Py_SET_ERANGE_ON_OVERFLOW(x)
***************
*** 321,325 ****
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
  #else
! #define Py_DEPRECATED(VERSION_UNUSED) 
  #endif
  
--- 326,330 ----
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
  #else
! #define Py_DEPRECATED(VERSION_UNUSED)
  #endif
  
***************
*** 396,403 ****
  
    PyAPI_FUNC(type): Declares a public Python API function and return type
!   PyAPI_DATA(type): Declares public Python data and its type 
    PyMODINIT_FUNC:   A Python module init function.  If these functions are
!                     inside the Python core, they are private to the core.  
!                     If in an extension module, it may be declared with 
                      external linkage depending on the platform.
  
--- 401,408 ----
  
    PyAPI_FUNC(type): Declares a public Python API function and return type
!   PyAPI_DATA(type): Declares public Python data and its type
    PyMODINIT_FUNC:   A Python module init function.  If these functions are
!                     inside the Python core, they are private to the core.
!                     If in an extension module, it may be declared with
                      external linkage depending on the platform.
  
***************
*** 406,410 ****
  */
  
! /* 
  All windows ports, except cygwin, are handled in PC/pyconfig.h
  BeOS is only other autoconf platform requiring special linkage handling
--- 411,415 ----
  */
  
! /*
  All windows ports, except cygwin, are handled in PC/pyconfig.h
  BeOS is only other autoconf platform requiring special linkage handling