github.com/prattmic/llgo-embedded@v0.0.0-20150820070356-41cfecea0e1e/third_party/gofrontend/libgo/runtime/go-main.c (about)

     1  /* go-main.c -- the main function for a Go program.
     2  
     3     Copyright 2009 The Go Authors. All rights reserved.
     4     Use of this source code is governed by a BSD-style
     5     license that can be found in the LICENSE file.  */
     6  
     7  #include "config.h"
     8  
     9  #include <stdlib.h>
    10  #include <time.h>
    11  #include <unistd.h>
    12  
    13  #ifdef HAVE_FPU_CONTROL_H
    14  #include <fpu_control.h>
    15  #endif
    16  
    17  #include "runtime.h"
    18  #include "go-alloc.h"
    19  #include "array.h"
    20  #include "arch.h"
    21  #include "malloc.h"
    22  
    23  #undef int
    24  #undef char
    25  #undef unsigned
    26  
    27  /* The main function for a Go program.  This records the command line
    28     parameters, calls the real main function, and returns a zero status
    29     if the real main function returns.  */
    30  
    31  extern char **environ;
    32  
    33  /* The main function.  */
    34  
    35  int
    36  main (int argc, char **argv)
    37  {
    38    runtime_check ();
    39    runtime_args (argc, (byte **) argv);
    40    runtime_osinit ();
    41    runtime_schedinit ();
    42    __go_go (runtime_main, NULL);
    43    runtime_mstart (runtime_m ());
    44    abort ();
    45  }