Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/lib/libc/crt1.c
6162 views
1
/*
2
* Copyright 2019 The Emscripten Authors. All rights reserved.
3
* Emscripten is available under two separate licenses, the MIT license and the
4
* University of Illinois/NCSA Open Source License. Both these licenses can be
5
* found in the LICENSE file.
6
*/
7
8
#include <stdlib.h>
9
#include <wasi/api.h>
10
11
__attribute__((__weak__)) void __wasm_call_ctors(void);
12
13
int __main_void(void);
14
15
void _start(void) {
16
if (__wasm_call_ctors) {
17
__wasm_call_ctors();
18
}
19
20
/*
21
* Will either end up calling the user's original zero argument main directly
22
* or our __original_main fallback in __original_main.c which handles
23
* populating argv.
24
*/
25
int r = __main_void();
26
27
exit(r);
28
}
29
30