summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-10-21 12:21:09 +0200
committerTyge Løvset <[email protected]>2020-10-21 12:21:09 +0200
commitf6d176021ec342e36946a1c6f00a7a6bb80f192e (patch)
treee50ec13d6b96004bfbd01bc7e9a6bb4d1c2f7bce
parentb58093ac37d62cdc4736f6d916ce438413391266 (diff)
downloadSTC-modified-f6d176021ec342e36946a1c6f00a7a6bb80f192e.tar.gz
STC-modified-f6d176021ec342e36946a1c6f00a7a6bb80f192e.zip
Fixed some VS signed char problems.
-rw-r--r--stc/cfmt.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/stc/cfmt.h b/stc/cfmt.h
index 94dab9ba..158ada20 100644
--- a/stc/cfmt.h
+++ b/stc/cfmt.h
@@ -40,9 +40,15 @@ _cfmt_conv(const char *fmt, ...);
int: _cfmt_printf, \
cstr_t *: cstr_fmt)
+#if defined(_MSC_VER) && !defined(__clang__)
+# define _cfmt_uschar unsigned char: "hhu"
+#else
+# define _cfmt_uschar signed char: "hhd", unsigned char: "hhu"
+#endif
+
#define _cfmt(x) _Generic ((x), \
char: "c", \
- unsigned char: "hhu", \
+ _cfmt_uschar, \
short: "hd", \
unsigned short: "hu", \
int: "d", \