mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibJS: Port to Windows
This commit is contained in:
parent
a291a7f770
commit
52d0341c5d
Notes:
github-actions[bot]
2025-02-06 22:17:49 +00:00
Author: https://github.com/stasoid
Commit: 52d0341c5d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2917
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 10 additions and 4 deletions
|
@ -275,8 +275,14 @@ if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i.86.*")
|
||||||
target_link_libraries(LibJS PRIVATE atomic)
|
target_link_libraries(LibJS PRIVATE atomic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This flag has no effect on Windows
|
if (WIN32)
|
||||||
if (NOT WIN32)
|
# FIXME: Windows on ARM
|
||||||
|
target_link_libraries(LibJS PRIVATE clang_rt.builtins-x86_64.lib)
|
||||||
|
# FIXME: This is a hack to get around lld-link error undefined symbol GC::HeapBlockBase::block_size
|
||||||
|
# LibGC HeapBlock.obj is given directly to LibJS linker
|
||||||
|
target_link_libraries(LibJS PRIVATE $<FILTER:$<TARGET_OBJECTS:LibGC>,INCLUDE,HeapBlock>)
|
||||||
|
else()
|
||||||
|
# This flag has no effect on Windows
|
||||||
target_compile_options(LibJS PRIVATE -fno-omit-frame-pointer)
|
target_compile_options(LibJS PRIVATE -fno-omit-frame-pointer)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Time.h>
|
#include <AK/Time.h>
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <LibJS/Contrib/Test262/AgentObject.h>
|
#include <LibJS/Contrib/Test262/AgentObject.h>
|
||||||
#include <LibJS/Runtime/GlobalObject.h>
|
#include <LibJS/Runtime/GlobalObject.h>
|
||||||
#include <LibJS/Runtime/Object.h>
|
#include <LibJS/Runtime/Object.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
namespace JS::Test262 {
|
namespace JS::Test262 {
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ JS_DEFINE_NATIVE_FUNCTION(AgentObject::monotonic_now)
|
||||||
JS_DEFINE_NATIVE_FUNCTION(AgentObject::sleep)
|
JS_DEFINE_NATIVE_FUNCTION(AgentObject::sleep)
|
||||||
{
|
{
|
||||||
auto milliseconds = TRY(vm.argument(0).to_i32(vm));
|
auto milliseconds = TRY(vm.argument(0).to_i32(vm));
|
||||||
::usleep(milliseconds * 1000);
|
(void)Core::System::sleep_ms(milliseconds);
|
||||||
return js_undefined();
|
return js_undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue