classification
Title: Removal of stale code in pyconfig.h
Type: enhancement Stage: test needed
Components: Build Versions: Python 3.1, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: loewis Nosy List: JosephArmbruster, akuchling, christian.heimes, loewis
Priority: low Keywords:

Created on 2007-11-28 14:14 by JosephArmbruster, last changed 2010-05-20 12:46 by loewis. This issue is now closed.

Messages (3)
msg57913 - (view) Author: Joseph Armbruster (JosephArmbruster) Date: 2007-11-28 14:14
Question:  Is there any harm in removing this block from pyconfig.h?

#ifndef PY_LONG_LONG
#	define PY_LONG_LONG __int64
#	define PY_LLONG_MAX _I64_MAX
#	define PY_LLONG_MIN _I64_MIN
#	define PY_ULLONG_MAX _UI64_MAX
#endif

pyconfig.h contains this small snippet:

/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
#define HAVE_LONG_LONG 1
#ifndef PY_LONG_LONG
#	define PY_LONG_LONG __int64
#	define PY_LLONG_MAX _I64_MAX
#	define PY_LLONG_MIN _I64_MIN
#	define PY_ULLONG_MAX _UI64_MAX
#endif


However, in pyport.h, I can see that PY_LONG_LONG may also be defined
here, except the tokens are slightly different:


#ifdef HAVE_LONG_LONG

	#ifndef PY_LONG_LONG
		#define PY_LONG_LONG long long
		
		#if defined(LLONG_MAX)
			/* If LLONG_MAX is defined in limits.h, use that. */
			#define PY_LLONG_MIN LLONG_MIN
			#define PY_LLONG_MAX LLONG_MAX
			#define PY_ULLONG_MAX ULLONG_MAX
		#elif defined(__LONG_LONG_MAX__)
			/* Otherwise, if GCC has a builtin define, use that. */
			#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)
		#endif /* LLONG_MAX */
	#endif
#endif /* HAVE_LONG_LONG */
msg99850 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2010-02-22 22:07
This turns out to refer to PC/pyconfig.h, not the top-level pyconfig.h.

It's not clear to me why you say that block of code is no longer used; can you expand on why that's the case?
msg106145 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-05-20 12:46
I think there is harm in removing this block; it would cause PY_LONG_LONG not to be defined anymore. Closing as invalid.
History
Date User Action Args
2010-05-20 12:46:07loewissetstatus: open -> closed
resolution: not a bug
messages: + msg106145
2010-02-22 22:07:04akuchlingsetnosy: + akuchling
messages: + msg99850
2009-03-30 22:20:42ajaksu2setstage: test needed
type: enhancement
versions: + Python 3.1, Python 2.7, - Python 3.0
2007-11-28 14:23:11christian.heimessetpriority: low
assignee: loewis
nosy: + loewis
2007-11-28 14:14:07JosephArmbrustercreate