diff options
author | Armin Rigo <arigo@tunes.org> | 2015-10-16 09:46:10 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-10-16 09:46:10 +0200 |
commit | 735a1c6fb470ba10006b4b39be6e05b6cac0b961 (patch) | |
tree | 52299fd18ea7422235a1ad4aeb603f7e5da5d372 /c | |
parent | 4a69b00ae4ae43d974034b68d996fe3e11679e45 (diff) | |
download | cffi-735a1c6fb470ba10006b4b39be6e05b6cac0b961.tar.gz |
win64 fix
Diffstat (limited to 'c')
-rw-r--r-- | c/parse_c_type.c | 9 |
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"); |