forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 python#101659 and bug python#115323.
- Loading branch information
Showing
25 changed files
with
42 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,6 +354,38 @@ typedef struct fd_set { | |
#endif /* fd manipulation macros */ | ||
|
||
|
||
/* 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 [email protected] | ||
*/ | ||
#undef LONG_MIN | ||
#define LONG_MIN (-LONG_MAX-1) | ||
#endif | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,36 +23,6 @@ | |
#define CHECK(x) /* Don't know how to check */ | ||
#endif | ||
|
||
#ifdef HAVE_LIMITS_H | ||
#include <limits.h> | ||
#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" | ||
#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 [email protected] | ||
*/ | ||
#undef LONG_MIN | ||
#define LONG_MIN (-LONG_MAX-1) | ||
#endif | ||
#endif | ||
|
||
#if !defined(__STDC__) && !defined(macintosh) | ||
extern double fmod(double, double); | ||
extern double pow(double, double); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters