[pypy-commit] cffi default: win64 fix

arigo noreply at buildbot.pypy.org
Fri Oct 16 04:10:22 EDT 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2345:2595d6ad4cb4
Date: 2015-10-16 09:46 +0200
http://bitbucket.org/cffi/cffi/changeset/2595d6ad4cb4/

Log:	win64 fix

diff --git a/c/parse_c_type.c b/c/parse_c_type.c
--- a/c/parse_c_type.c
+++ b/c/parse_c_type.c
@@ -376,11 +376,14 @@
 
             case TOK_INTEGER:
                 errno = 0;
-#ifndef MS_WIN32
-                if (sizeof(length) > sizeof(unsigned long))
+                if (sizeof(length) > sizeof(unsigned long)) {
+#ifdef MS_WIN32     /* actually for win64 */
+                    length = _strtoui64(tok->p, &endptr, 0);
+#else
                     length = strtoull(tok->p, &endptr, 0);
+#endif
+                }
                 else
-#endif
                     length = strtoul(tok->p, &endptr, 0);
                 if (endptr != tok->p + tok->size)
                     return parse_error(tok, "invalid number");


More information about the pypy-commit mailing list