--- pytables-1.3.2/setup.py.win64	2006-03-24 11:54:34.000000000 +0100
+++ pytables-1.3.2/setup.py	2006-07-17 20:39:48.187500000 +0200
@@ -211,6 +211,8 @@
         'LZO': ['liblzo', 'lzo1'],
         'UCL': ['libucl', 'ucl1'],
         'BZ2': ['bzip2', 'bzip2'], }
+    if '--debug' in sys.argv:
+        _platdep['HDF5'] = ['hdf5ddll', 'hdf5ddll']
 
 hdf5_package = _Package("HDF5", 'HDF5', 'H5public', *_platdep['HDF5'])
 lzo2_package = _Package("LZO 2", 'LZO2', _cp('lzo/lzo1x'), *_platdep['LZO2'])
@@ -263,7 +265,8 @@
         sys.argv.remove(arg)
     elif arg.find('--debug') == 0:
         # For debugging (mainly compression filters)
-        def_macros = [('DEBUG', 1)]
+        if os.name != 'nt': # to prevent including dlfcn.h by utils.c!!! 
+            def_macros = [('DEBUG', 1)]
         # Don't delete this argument. It maybe useful for distutils
         # when adding more flags later on
         #sys.argv.remove(arg)
--- pytables-1.3.2/src/utils.c.win64	2006-03-25 19:37:16.000000000 +0100
+++ pytables-1.3.2/src/utils.c	2006-07-17 20:54:53.171875000 +0200
@@ -60,13 +60,15 @@
 #endif  /* Win32 */
 
 herr_t set_cache_size(hid_t file_id, size_t cache_size) {
+#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR >= 7
+  /* MSVS2005 chokes on declarations after statements */
+  H5AC_cache_config_t config;
+#endif /* if H5_VERSION < "1.7" */
   herr_t code;
 
   code = 0;
 
 #if H5_VERS_MAJOR == 1 && H5_VERS_MINOR >= 7
-  H5AC_cache_config_t config;
-
   config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
   code = H5Fget_mdc_config(file_id, &config);
   config.set_initial_size = TRUE;
--- pytables-1.3.2/tables/utils.py.win64	2006-06-19 13:46:43.000000000 +0200
+++ pytables-1.3.2/tables/utils.py	2006-07-17 20:39:48.203125000 +0200
@@ -20,11 +20,24 @@
 import sys
 
 # Trick to know if we are on a 64-bit platform or not
-if sys.maxint > (2**31)-1:
+# However, a long has 32 bits on Windows AMD64 and on this
+# platform Numeric behaves as if it is running on 32 bits:
+# has64bits_long is a better name than is64bits_platform.
+if sys.maxint > (2**31)-1 and sys.platform != 'win32':
     is64bits_platform = True
 else:
     is64bits_platform = False
 
+# Alternative (not so hackish):
+import struct
+if struct.calcsize('l') == 8:
+    is64bits_platform = True
+elif struct.calcsize('l') == 4:
+    is64bits_platform = False
+else:
+    raise SystemExit, "unexpected size of long"
+
+
 import numarray
 from numarray import strings
 from numarray import records
