summaryrefslogtreecommitdiff
path: root/gl/printf-parse.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-10-21 09:56:40 +0000
committerSimon Josefsson <simon@josefsson.org>2006-10-21 09:56:40 +0000
commit88737f5d01172764cbfd26d7a778603bcf61ccda (patch)
tree5c171f586a09dfe768b91af6b8ba49f3f5a954e4 /gl/printf-parse.c
parenta26afd5bdeeb76bb2160e56010728167b43466d6 (diff)
downloadgnutls-88737f5d01172764cbfd26d7a778603bcf61ccda.tar.gz
Update.
Diffstat (limited to 'gl/printf-parse.c')
-rw-r--r--gl/printf-parse.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index bbf16ce8db..f0247c22c0 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -382,11 +382,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
switch (c)
{
case 'd': case 'i':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_LONGLONGINT;
else
#endif
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lld" into TYPE_LONGINT. */
if (flags >= 8)
type = TYPE_LONGINT;
else if (flags & 2)
@@ -397,11 +400,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
type = TYPE_INT;
break;
case 'o': case 'u': case 'x': case 'X':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_ULONGLONGINT;
else
#endif
+ /* If 'unsigned long long' exists and is the same as
+ 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
if (flags >= 8)
type = TYPE_ULONGINT;
else if (flags & 2)
@@ -456,11 +462,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
type = TYPE_POINTER;
break;
case 'n':
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
+ /* If 'long long' exists and is larger than 'long': */
if (flags >= 16 || (flags & 4))
type = TYPE_COUNT_LONGLONGINT_POINTER;
else
#endif
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lln" into TYPE_COUNT_LONGINT_POINTER. */
if (flags >= 8)
type = TYPE_COUNT_LONGINT_POINTER;
else if (flags & 2)