Luna/libos/src/Main.cpp
apio 0fad179485
All checks were successful
continuous-integration/drone/push Build is passing
apps+libc+libos: Remove _LUNA_SYSTEM_ERROR_EXTENSIONS and reorder headers
libluna/libos headers can now go after errno.h, so there's no reason to keep them separate.
2023-05-02 10:51:53 +02:00

23 lines
366 B
C++

#include <errno.h>
#include <os/Main.h>
#include <stdio.h>
int g_argc;
char** g_argv;
__attribute__((weak)) int main(int argc, char** argv)
{
g_argc = argc;
g_argv = argv;
int result;
bool ok = luna_main(argc, argv).try_set_value_or_error(result, errno);
if (!ok)
{
perror(g_argv[0]);
return 1;
}
return result;
}