From dab190e857860527e540dddd263f48e85d1d2948 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sat, 18 Jan 2025 20:27:44 +0100
Subject: eizoctl: fix message formatting on Windows
This increases the binary size, but at least we stop showing
Chinese characters instead of ASCII.
---
eizoctl.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/eizoctl.c b/eizoctl.c
index c790c7f..cf984a0 100644
--- a/eizoctl.c
+++ b/eizoctl.c
@@ -18,6 +18,14 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
+
+// On Windows, vswprintf() interprets %s in the width of the format string,
+// and %hs is not really compliant with any standard:
+// https://devblogs.microsoft.com/oldnewthing/20190830-00/?p=102823
+#ifdef _WIN32
+#define __USE_MINGW_ANSI_STDIO
+#endif
+
#include