summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Puffke <pascalpuffke@protonmail.ch>2021-11-22 23:24:55 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-22 23:56:22 +0100
commit41b80f3d85c972e5c1a687707bfe48db8cc15ac2 (patch)
tree69d4e3cc65919afae475abd8ef5ae8b8e0dc4a82
parent61408e239758fa2dbe1af289b3789110311de035 (diff)
downloadserenity-41b80f3d85c972e5c1a687707bfe48db8cc15ac2.zip
Piano: Port to LibMain
-rw-r--r--Userland/Applications/Piano/CMakeLists.txt2
-rw-r--r--Userland/Applications/Piano/main.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/Userland/Applications/Piano/CMakeLists.txt b/Userland/Applications/Piano/CMakeLists.txt
index 19717985e8..60a49f7731 100644
--- a/Userland/Applications/Piano/CMakeLists.txt
+++ b/Userland/Applications/Piano/CMakeLists.txt
@@ -21,4 +21,4 @@ set(SOURCES
)
serenity_app(Piano ICON app-piano)
-target_link_libraries(Piano LibAudio LibDSP LibGUI)
+target_link_libraries(Piano LibAudio LibDSP LibGUI LibMain)
diff --git a/Userland/Applications/Piano/main.cpp b/Userland/Applications/Piano/main.cpp
index fec6390aa9..53f322e393 100644
--- a/Userland/Applications/Piano/main.cpp
+++ b/Userland/Applications/Piano/main.cpp
@@ -22,15 +22,14 @@
#include <LibGUI/Menubar.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Window.h>
+#include <LibMain/Main.h>
+#include <LibSystem/Wrappers.h>
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- if (pledge("stdio thread rpath cpath wpath recvfd sendfd unix", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(System::pledge("stdio thread rpath cpath wpath recvfd sendfd unix", nullptr));
- auto app = GUI::Application::construct(argc, argv);
+ auto app = GUI::Application::construct(arguments.argc, arguments.argv);
TrackManager track_manager;