mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
By linking with LibMain, your program no longer needs to provide main().
Instead, execution begins in this function:
ErrorOr<int> serenity_main(Main::Arguments);
This allows programs that link with LibMain to use TRY() already in
their entry function, without having to do manual ErrorOr unwrapping.
This is very experimental, but it seems like a nice idea so let's try it
out. :^)
22 lines
307 B
C++
22 lines
307 B
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Error.h>
|
|
|
|
namespace Main {
|
|
|
|
struct Arguments {
|
|
int argc {};
|
|
char** argv {};
|
|
Span<StringView> arguments;
|
|
};
|
|
|
|
}
|
|
|
|
ErrorOr<int> serenity_main(Main::Arguments);
|