mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Provide PY_LLONG_MAX on all systems having long long.
This commit is contained in:
		
							parent
							
								
									e99cb23e71
								
							
						
					
					
						commit
						7d18356db7
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
					@ -62,14 +62,20 @@ Used in:  PY_LONG_LONG
 | 
				
			||||||
#ifndef PY_LONG_LONG
 | 
					#ifndef PY_LONG_LONG
 | 
				
			||||||
#define PY_LONG_LONG long long
 | 
					#define PY_LONG_LONG long long
 | 
				
			||||||
#if defined(LLONG_MAX)
 | 
					#if defined(LLONG_MAX)
 | 
				
			||||||
 | 
					/* If LLONG_MAX is defined in limits.h, use that. */
 | 
				
			||||||
#define PY_LLONG_MIN LLONG_MIN
 | 
					#define PY_LLONG_MIN LLONG_MIN
 | 
				
			||||||
#define PY_LLONG_MAX LLONG_MAX
 | 
					#define PY_LLONG_MAX LLONG_MAX
 | 
				
			||||||
#define PY_ULLONG_MAX ULLONG_MAX
 | 
					#define PY_ULLONG_MAX ULLONG_MAX
 | 
				
			||||||
#elif defined(__s390__)
 | 
					#elif defined(__LONG_LONG_MAX__)
 | 
				
			||||||
/* Apparently, S390 Linux has long long, but no LLONG_MAX */
 | 
					/* Otherwise, if GCC has a builtin define, use that. */
 | 
				
			||||||
#define PY_LLONG_MAX 9223372036854775807LL
 | 
					#define PY_LLONG_MAX __LONG_LONG_MAX__
 | 
				
			||||||
 | 
					#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
 | 
				
			||||||
 | 
					#define PY_ULLONG_MAX (__LONG_LONG_MAX__*2ULL + 1ULL)
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					/* Otherwise, rely on two's complement. */
 | 
				
			||||||
 | 
					#define PY_ULLONG_MAX (~0ULL)
 | 
				
			||||||
 | 
					#define PY_LLONG_MAX  ((long long)(PY_ULLONG_MAX>>1))
 | 
				
			||||||
#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
 | 
					#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
 | 
				
			||||||
#define PY_ULLONG_MAX 18446744073709551615ULL
 | 
					 | 
				
			||||||
#endif /* LLONG_MAX */
 | 
					#endif /* LLONG_MAX */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#endif /* HAVE_LONG_LONG */
 | 
					#endif /* HAVE_LONG_LONG */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue