tree-optimization/118653 - ICE in vectorizable_live_operation
[gcc.git] / libphobos / libdruntime / core / internal / entrypoint.d
blob839c120bfcf2c73ca386c5250e28dd0fdbe2bd1f
1 /**
2 This module contains the code for C main and any call(s) to initialize the
3 D runtime and call D main.
5 Copyright: Copyright Digital Mars 2000 - 2019.
6 License: Distributed under the
7 $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
8 (See accompanying file LICENSE)
9 Source: $(DRUNTIMESRC core/_internal/_entrypoint.d)
11 module core.internal.entrypoint;
13 /**
14 A template containing C main and any call(s) to initialize druntime and
15 call D main. Any module containing a D main function declaration will
16 cause the compiler to generate a `mixin _d_cmain();` statement to inject
17 this code into the module.
19 template _d_cmain()
21 extern(C)
23 int _d_run_main(int argc, char **argv, void* mainFunc);
25 int _Dmain(char[][] args);
27 int main(int argc, char **argv)
29 return _d_run_main(argc, argv, &_Dmain);
32 // Solaris, for unknown reasons, requires both a main() and an _main()
33 version (Solaris)
35 int _main(int argc, char** argv)
37 return main(argc, argv);