Truly independent web browser
/*
* Copyright (c) 2023, Liav A. <[email protected]>
* Copyright (c) 2023, Cameron Youell <[email protected]>
* Copyright (c) 2024-2025, stasoid <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Error.h>
#ifdef AK_OS_WINDOWS
# include <AK/ByteString.h>
# include <AK/HashMap.h>
# include <windows.h>
// Comment to prevent clang-format from including windows.h too late
# include <winbase.h>
#endif
namespace AK {
#ifdef AK_OS_WINDOWS
Error Error::from_windows_error(u32 windows_error)
{
return Error(static_cast<int>(windows_error), Error::Kind::Windows);
}
// This can be used both for generic Windows errors and for winsock errors because WSAGetLastError is forwarded to GetLastError.
Error Error::from_windows_error()
{
return from_windows_error(GetLastError());
}
#endif
}