Skip to content

Commit

Permalink
Lagom: Fix printf implementation on win32
Browse files Browse the repository at this point in the history
It seems that Filip has already done the hard work, and found out the
implementation different between unix* and windows.

Borrowed from:
SerenityOS/serenity@master...filiphsps:serenity:dev-win32#diff-e3209c9a434a102d0d9459e31e33ddb729dff925b95f41b9d1e56c1e7f88c487R466

Co-authored-by: Filiph Sandström <[email protected]>
  • Loading branch information
2 people authored and linusg committed Sep 29, 2022
1 parent 1825760 commit 58a4403
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions AK/PrintfImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ template<typename T, typename V>
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
}
};

Expand Down

0 comments on commit 58a4403

Please sign in to comment.