summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-10-16 09:46:10 +0200
committerArmin Rigo <arigo@tunes.org>2015-10-16 09:46:10 +0200
commit735a1c6fb470ba10006b4b39be6e05b6cac0b961 (patch)
tree52299fd18ea7422235a1ad4aeb603f7e5da5d372 /c
parent4a69b00ae4ae43d974034b68d996fe3e11679e45 (diff)
downloadcffi-735a1c6fb470ba10006b4b39be6e05b6cac0b961.tar.gz
win64 fix
Diffstat (limited to 'c')
-rw-r--r--c/parse_c_type.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/c/parse_c_type.c b/c/parse_c_type.c
index 511f243..0af582e 100644
--- a/c/parse_c_type.c
+++ b/c/parse_c_type.c
@@ -376,11 +376,14 @@ static int parse_sequel(token_t *tok, int outer)
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);
- else
#endif
+ }
+ else
length = strtoul(tok->p, &endptr, 0);
if (endptr != tok->p + tok->size)
return parse_error(tok, "invalid number");