From 3a3f0c8ed8f28b389f3de1dd78ec822ed0b27ed3 Mon Sep 17 00:00:00 2001 From: johanknol Date: Mon, 8 Oct 2001 10:24:00 +0000 Subject: [PATCH] fixed bug #468811 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1374 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCval.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/SDCCval.c b/src/SDCCval.c index a9b17d63..1d18f7ef 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -29,6 +29,12 @@ #include #include "newalloc.h" +#if defined(__BORLANDC__) || defined(_MSC_VER) +#define LONG_LONG __int64 +#else +#define LONG_LONG long long +#endif + int cNestLevel; /*-----------------------------------------------------------------*/ @@ -420,7 +426,7 @@ value *constVal (char *s) short hex = 0, octal = 0; char scanFmt[10]; int scI = 0; - unsigned long sval; + LONG_LONG sval; val = newValue (); /* alloc space for value */ @@ -444,6 +450,8 @@ value *constVal (char *s) /* create the scan string */ scanFmt[scI++] = '%'; + scanFmt[scI++] = 'L'; + if (octal) scanFmt[scI++] = 'o'; else if (hex) @@ -451,7 +459,6 @@ value *constVal (char *s) else scanFmt[scI++] = 'd'; - scanFmt[scI++] = 'L'; scanFmt[scI++] = '\0'; sscanf (s, scanFmt, &sval); -- 2.30.2