From 58a44036a9ffd5880d89cf631f93c2649e48a173 Mon Sep 17 00:00:00 2001 From: Diego Iastrubni Date: Tue, 20 Sep 2022 15:56:51 +0300 Subject: [PATCH] Lagom: Fix printf implementation on win32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that Filip has already done the hard work, and found out the implementation different between unix* and windows. Borrowed from: https://github.com/SerenityOS/serenity/compare/master...filiphsps:serenity:dev-win32#diff-e3209c9a434a102d0d9459e31e33ddb729dff925b95f41b9d1e56c1e7f88c487R466 Co-authored-by: Filiph Sandström --- AK/PrintfImplementation.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AK/PrintfImplementation.h b/AK/PrintfImplementation.h index f9a46ce10f4..fdb1b026c95 100644 --- a/AK/PrintfImplementation.h +++ b/AK/PrintfImplementation.h @@ -463,7 +463,14 @@ template struct VaArgNextArgument { ALWAYS_INLINE T operator()(V ap) const { +#ifdef AK_OS_WINDOWS + // GCC on msys2 complains about the type of ap, + // so let's force the compiler to belive its a + // va_list. + return va_arg((va_list&)ap, T); +#else return va_arg(ap, T); +#endif } };