diff --git a/Userland/Games/Spider/CMakeLists.txt b/Userland/Games/Spider/CMakeLists.txt index d7fa9dfcce..f688fc8ac5 100644 --- a/Userland/Games/Spider/CMakeLists.txt +++ b/Userland/Games/Spider/CMakeLists.txt @@ -13,4 +13,4 @@ set(SOURCES ) serenity_app(Spider ICON app-spider) -target_link_libraries(Spider LibCards LibGUI LibGfx LibCore LibConfig) +target_link_libraries(Spider LibCards LibGUI LibGfx LibCore LibConfig LibMain) diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp index a5dcb38425..8df279c878 100644 --- a/Userland/Games/Spider/main.cpp +++ b/Userland/Games/Spider/main.cpp @@ -18,8 +18,9 @@ #include #include #include +#include +#include #include -#include enum class StatisticDisplay : u8 { HighScore, @@ -36,32 +37,19 @@ static String format_seconds(uint64_t seconds_elapsed) return String::formatted("{:02}:{:02}:{:02}", hours, minutes, seconds); } -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(System::pledge("stdio recvfd sendfd rpath unix", nullptr)); - auto app = GUI::Application::construct(argc, argv); + auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app_icon = GUI::Icon::default_icon("app-spider"); Config::pledge_domains("Spider"); - if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(System::pledge("stdio recvfd sendfd rpath", nullptr)); - if (unveil("/res", "r") < 0) { - perror("unveil"); - return 1; - } - - if (unveil(nullptr, nullptr) < 0) { - perror("unveil"); - return 1; - } + TRY(System::unveil("/res", "r")); + TRY(System::unveil(nullptr, nullptr)); auto window = GUI::Window::construct(); window->set_title("Spider");