diff --git a/AK/CMakeLists.txt b/AK/CMakeLists.txt index 3fbdc65b90a9d..0d40fb2e5c695 100644 --- a/AK/CMakeLists.txt +++ b/AK/CMakeLists.txt @@ -74,6 +74,7 @@ if (BUILD_SHARED_LIBS AND NOT CMAKE_SKIP_INSTALL_RULES AND NOT "${VCPKG_INSTALLE ) endif() +set(SWIFT_EXCLUDE_HEADERS Windows.h) if (ENABLE_SWIFT) generate_clang_module_map(AK GENERATED_FILES diff --git a/AK/Time.cpp b/AK/Time.cpp index 923f6404da6a2..d10340e5978ae 100644 --- a/AK/Time.cpp +++ b/AK/Time.cpp @@ -8,9 +8,7 @@ #include #ifdef AK_OS_WINDOWS -# define timeval dummy_timeval -# include -# undef timeval +# include #endif namespace AK { diff --git a/AK/Windows.h b/AK/Windows.h new file mode 100644 index 0000000000000..b29f68d6df09a --- /dev/null +++ b/AK/Windows.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024, stasoid + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +#ifdef AK_OS_WINDOWS // needed for Swift +# define timeval dummy_timeval +# include +# undef timeval +# include +#endif