ladybird/LibC/entry.cpp
Andreas Kling 2def3d8d3f LibGUI: Start adding an automatic widget layout system.
My needs are really quite simple, so I'm just going to add what I need
as I go along. The first thing I needed was a simple box layout with
widgets being able to say whether they prefer fixed or fill for both
their vertical and horizontal sizes.

I also made a simple GStatusBar so FileManager can show how many bytes
worth of files are in the current directory.
2019-02-10 11:07:13 +01:00

46 lines
821 B
C++

#include <stdio.h>
#include <string.h>
#include <Kernel/Syscall.h>
#include <AK/StringImpl.h>
extern "C" int main(int, char**);
int errno;
char** environ;
extern "C" void __malloc_init();
extern "C" void __stdio_init();
extern "C" int _start()
{
errno = 0;
__stdio_init();
__malloc_init();
int status = 254;
int argc;
char** argv;
int rc = syscall(SC_get_arguments, &argc, &argv);
if (rc < 0)
goto epilogue;
rc = syscall(SC_get_environment, &environ);
if (rc < 0)
goto epilogue;
status = main(argc, argv);
fflush(stdout);
fflush(stderr);
epilogue:
syscall(SC_exit, status);
// Birger's birthday <3
return 20150614;
}
extern "C" void __cxa_pure_virtual() NORETURN;
extern "C" void __cxa_pure_virtual()
{
ASSERT_NOT_REACHED();
}