[Python-checkins] CVS: python/dist/src/Include Python.h,2.29,2.30 longobject.h,2.18,2.19 pyport.h,2.19,2.20

Fred L. Drake python-dev@python.org
Mon, 25 Sep 2000 22:46:03 -0700


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

Modified Files:
	Python.h longobject.h pyport.h 
Log Message:

Rationalize use of limits.h, moving the inclusion to Python.h.
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.

This closes SourceForge patch #101659 and bug #115323.


Index: Python.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -r2.29 -r2.30
*** Python.h	2000/09/19 00:46:46	2.29
--- Python.h	2000/09/26 05:45:59	2.30
***************
*** 24,27 ****
--- 24,31 ----
  #include "config.h"
  
+ #ifdef HAVE_LIMITS_H
+ #include <limits.h>
+ #endif
+ 
  /* config.h may or may not define DL_IMPORT */
  #ifndef DL_IMPORT	/* declarations for DLL import/export */

Index: longobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v
retrieving revision 2.18
retrieving revision 2.19
diff -C2 -r2.18 -r2.19
*** longobject.h	2000/09/01 23:29:26	2.18
--- longobject.h	2000/09/26 05:45:59	2.19
***************
*** 25,36 ****
  #ifdef HAVE_LONG_LONG
  
- #ifdef HAVE_LIMITS_H
- #include <limits.h>
- #endif
- 
  /* Hopefully this is portable... */
- #ifndef LONG_MAX
- #define LONG_MAX 2147483647L
- #endif
  #ifndef ULONG_MAX
  #define ULONG_MAX 4294967295U
--- 25,29 ----

Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.19
retrieving revision 2.20
diff -C2 -r2.19 -r2.20
*** pyport.h	2000/09/10 01:02:41	2.19
--- pyport.h	2000/09/26 05:46:00	2.20
***************
*** 355,358 ****
--- 355,390 ----
  
  
+ /* limits.h constants that may be missing */
+ 
+ #ifndef INT_MAX
+ #define INT_MAX 2147483647
+ #endif
+ 
+ #ifndef LONG_MAX
+ #if SIZEOF_LONG == 4
+ #define LONG_MAX 0X7FFFFFFFL
+ #elif SIZEOF_LONG == 8
+ #define LONG_MAX 0X7FFFFFFFFFFFFFFFL
+ #else
+ #error "could not set LONG_MAX in pyport.h"
+ #endif
+ #endif
+ 
+ #ifndef LONG_MIN
+ #define LONG_MIN (-LONG_MAX-1)
+ #endif
+ 
+ #ifdef __NeXT__
+ #ifdef __sparc__
+ /*
+  * This works around a bug in the NS/Sparc 3.3 pre-release
+  * limits.h header file.
+  * 10-Feb-1995 bwarsaw@cnri.reston.va.us
+  */
+ #undef LONG_MIN
+ #define LONG_MIN (-LONG_MAX-1)
+ #endif
+ #endif
+ 
  #ifdef __cplusplus
  }