From 9e73da7340947390d81f035abc70d37d31c029c0 Mon Sep 17 00:00:00 2001 From: Bill Medland Date: Thu, 20 Apr 2006 15:32:00 -0700 Subject: [PATCH] wpp: Implement long long constant parsing. --- libs/wpp/ppl.l | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 073a6ac8087..990fbb14f11 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -821,9 +821,24 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len) } if(is_ll) - pp_internal_error(__FILE__, __LINE__, "long long constants not implemented yet"); - - if(is_u && is_l) + { +/* Assume as in the declaration of wrc_ull_t and wrc_sll_t */ +#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8 + if (is_u) + { + val->ull = strtoull(str, NULL, radix); + return tULONGLONG; + } + else + { + val->sll = strtoll(str, NULL, radix); + return tSLONGLONG; + } +#else + pp_internal_error(__FILE__, __LINE__, "long long constants not supported on this platform"); +#endif + } + else if(is_u && is_l) { val->ulong = strtoul(str, NULL, radix); return tULONG;