Browse Source

turns out sys.maxint isn't reliable on windows. Feh.

David Rose 14 years ago
parent
commit
5a1c474c31
1 changed files with 12 additions and 2 deletions
  1. 12 2
      makepanda/makepandacore.py

+ 12 - 2
makepanda/makepandacore.py

@@ -25,8 +25,18 @@ OPTIMIZE="3"
 VERBOSE=False
 LINK_ALL_STATIC=False
 
-# platform.architecture isn't reliable on OSX.
-is_64 = (sys.maxint > 0x100000000L)
+# Is the current Python a 32-bit or 64-bit build?  There doesn't
+# appear to be a universal test for this.
+if sys.platform == 'darwin':
+    # On OSX, platform.architecture reports '64bit' even if it is
+    # currently running in 32-bit mode.  But sys.maxint is a reliable
+    # indicator.
+    is_64 = (sys.maxint > 0x100000000L)
+else:
+    # On Windows (and Linux?) sys.maxint reports 0x7fffffff even on a
+    # 64-bit build.  So we stick with platform.architecture in that
+    # case.
+    is_64 = (platform.architecture()[0] == '64bit')
 
 ########################################################################
 ##