Split up "gfortran.dg/goacc/loop-2.f95"
[official-gcc.git] / libphobos / libdruntime / __entrypoint.di
blob7bae2388d56662fe6c3f498a243b8eed900647f6
1 /* GDC -- D front-end for GCC
2    Copyright (C) 2013-2018 Free Software Foundation, Inc.
4    GCC is free software; you can redistribute it and/or modify it under
5    the terms of the GNU General Public License as published by the Free
6    Software Foundation; either version 3, or (at your option) any later
7    version.
9    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10    WARRANTY; without even the implied warranty of MERCHANTABILITY or
11    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12    for more details.
14    You should have received a copy of the GNU General Public License
15    along with GCC; see the file COPYING3.  If not see
16    <http://www.gnu.org/licenses/>.
19 /* This module provides the C main() function supplied by the user's program.  */
21 module __entrypoint;
23 extern(C):
25 /* The D main() function supplied by the user's program
27    It always has `_Dmain` symbol name and uses C calling convention.
28    But D frontend returns its type as `extern(D)` because of Issue 9028.
29    As we need to deal with actual calling convention we have to mark it
30    as `extern(C)` and use its symbol name.
33 int _Dmain(char[][] args);
34 int _d_run_main(int argc, char **argv, void* mainFunc);
36 /* Substitutes for the C main() function.  Just calls into d_run_main with
37    the default main function.  Applications are free to implement their own
38    main function and call the _d_run_main function themselves with any main
39    function.
42 int main(int argc, char **argv)
44     return _d_run_main(argc, argv, &_Dmain);
47 /* This is apparently needed on Solaris because the C tool chain seems to
48    expect the main function to be called _main.  It needs both not just one!
51 version (Solaris)
52 int _main(int argc, char** argv)
54     return main(argc, argv);