summaryrefslogtreecommitdiff
path: root/AK/Singleton.h
diff options
context:
space:
mode:
authorDiego Iastrubni <diegoiast@gmail.com>2022-09-20 10:15:12 +0300
committerLinus Groh <mail@linusgroh.de>2022-09-29 17:01:22 +0100
commit18257604ebffbac2dca2e802573dd219836c4be0 (patch)
tree572ed7c181f43d4f37900429e1029db5cc0da877 /AK/Singleton.h
parent767b23c4aa599ebefe0e344608e0c255cc32e45a (diff)
downloadserenity-18257604ebffbac2dca2e802573dd219836c4be0.zip
Lagom: Win32 support baby steps
This is the initial port of Lagom to win32. This will enable developers to use Lagom as an alternative to vanilla STL/StandardC++Library - which gives a much richer environment (think QtCore - but modern). My main incentive - is to have a native Windows Ladybird working. I am starting with AK, which does not yet fully compile (on mingw). When AK is compiling (currently fails building StringBuffer.cpp) - I will continue to LibCore and then the rest of the user space libraries (excluding the GUI, which will be another different effort). Most of the code is happily stollen from Andrew Kaster's fork - he deserves the credit. Co-authored-by: Andrew Kaster <akaster@serenityos.org>
Diffstat (limited to 'AK/Singleton.h')
-rw-r--r--AK/Singleton.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/Singleton.h b/AK/Singleton.h
index a0c6fa3290..c74b332469 100644
--- a/AK/Singleton.h
+++ b/AK/Singleton.h
@@ -13,6 +13,12 @@
# include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h>
# include <Kernel/Locking/SpinlockProtected.h>
+#elif defined(AK_OS_WINDOWS)
+// Forward declare to avoid pulling Windows.h into every file in existence.
+extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long);
+# ifndef sched_yield
+# define sched_yield() Sleep(0)
+# endif
#else
# include <sched.h>
#endif