summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@nil.im>2020-05-16 19:17:52 +0200
committerJonathan Schleifer <js@nil.im>2020-05-16 19:17:52 +0200
commitb38d9296fc349514fd289b43e32f34761e440bcc (patch)
treeaeb9d9b1bbc27ef5519e46b10f1d86750a4ca7cb
parent0f18bfc5b46d07b4cc80d9669eb03a19e6c12eb2 (diff)
Don't use %I on Windows
Older versions only understand I64. So only use I64 where appropriate and drop it entirely where not.
-rw-r--r--src/of_asprintf.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/of_asprintf.m b/src/of_asprintf.m
index eb795c54..64fe08c1 100644
--- a/src/of_asprintf.m
+++ b/src/of_asprintf.m
@@ -306,8 +306,9 @@ formatLengthModifierState(struct context *ctx)
break;
case 'z':
#if defined(OF_WINDOWS)
- if (!appendSubformat(ctx, "I", 1))
- return false;
+ if (sizeof(size_t) == 8)
+ if (!appendSubformat(ctx, "I64", 3))
+ return false;
#elif defined(_NEWLIB_VERSION)
if (!appendSubformat(ctx, "l", 1))
return false;
@@ -321,8 +322,9 @@ formatLengthModifierState(struct context *ctx)
break;
case 't':
#if defined(OF_WINDOWS)
- if (!appendSubformat(ctx, "I", 1))
- return false;
+ if (sizeof(ptrdiff_t) == 8)
+ if (!appendSubformat(ctx, "I64", 3))
+ return false;
#elif defined(_NEWLIB_VERSION)
if (!appendSubformat(ctx, "l", 1))
return false;