Only build the 'dl' extension when sys.maxint equals 2**31-1.

This module raises "SystemError: module dl requires sizeof(int) ==
sizeof(long) == sizeof(char*)" when compiled on 64-bit platforms.
This commit is contained in:
Guido van Rossum 2002-09-12 14:41:20 +00:00
parent ed44dbd959
commit 770acd3f7f
1 changed files with 5 additions and 3 deletions

View File

@ -732,6 +732,8 @@ class PyBuildExt(build_ext):
)) ))
# Dynamic loading module # Dynamic loading module
if sys.maxint == 0x7fffffff:
# This requires sizeof(int) == sizeof(long) == sizeof(char*)
dl_inc = find_file('dlfcn.h', [], inc_dirs) dl_inc = find_file('dlfcn.h', [], inc_dirs)
if (dl_inc is not None) and (platform not in ['atheos']): if (dl_inc is not None) and (platform not in ['atheos']):
exts.append( Extension('dl', ['dlmodule.c']) ) exts.append( Extension('dl', ['dlmodule.c']) )