[pypy-commit] pypy win64-stage1: Fixed a major bug concerning Signed/Unsigned and setup() errors.
ctismer
noreply at buildbot.pypy.org
Thu Dec 1 01:31:27 CET 2011
Author: Christian Tismer <tismer at stackless.com>
Branch: win64-stage1
Changeset: r50030:da6c8b877b3f
Date: 2011-12-01 01:30 +0100
http://bitbucket.org/pypy/pypy/changeset/da6c8b877b3f/
Log: Fixed a major bug concerning Signed/Unsigned and setup() errors.
Finding this bug did cost me over two days. I was not aware that the
g_prerequisite.h does not get included into the special Python.h,
which I was also not aware of. I have not so much problems finding
failures, but setup() errors in masses are a special challenge ;-)
Hopefully this changes a lot in the Buildbot output.
diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
--- a/pypy/module/cpyext/include/Python.h
+++ b/pypy/module/cpyext/include/Python.h
@@ -35,6 +35,8 @@
# define Py_LOCAL_INLINE(type) static __inline type __fastcall
#endif
+#include "signed_defn.h"
+
/* Deprecated DL_IMPORT and DL_EXPORT macros */
#ifdef _WIN32
# if defined(Py_BUILD_CORE)
diff --git a/pypy/translator/c/src/g_prerequisite.h b/pypy/translator/c/src/g_prerequisite.h
--- a/pypy/translator/c/src/g_prerequisite.h
+++ b/pypy/translator/c/src/g_prerequisite.h
@@ -8,14 +8,7 @@
# include "Python.h"
#endif
-#ifdef _WIN64
-# define Signed __int64
-# define SIGNED_MIN LLONG_MIN
-#else
-# define Signed long
-# define SIGNED_MIN LONG_MIN
-#endif
-#define Unsigned unsigned Signed
+#include "signed_defn.h"
#ifdef _WIN32
# include <io.h> /* needed, otherwise _lseeki64 truncates to 32-bits (??) */
diff --git a/pypy/translator/c/src/signed_defn.h b/pypy/translator/c/src/signed_defn.h
new file mode 100644
--- /dev/null
+++ b/pypy/translator/c/src/signed_defn.h
@@ -0,0 +1,13 @@
+/* this file defines Signed and Unsigned */
+
+#ifdef _WIN64
+ typedef __int64 Signed;
+ typedef unsigned __int64 Unsigned;
+# define SIGNED_MIN LLONG_MIN
+#else
+ typedef long Signed;
+ typedef unsigned long Unsigned;
+# define SIGNED_MIN LONG_MIN
+#endif
+
+/* end of signed_def.h */
More information about the pypy-commit
mailing list