summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/h8300/h8sim/startup/__main.c
blob: 4169cea605ffdd4fd9c27359f8407baae5527a07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 *  Copied from newlib 1.8.2
 *
 *  $Id$
 */

void __main ()
{
  static int initialized;
  if (! initialized)
    {
      typedef void (*pfunc) ();
      extern pfunc __ctors[];
      extern pfunc __ctors_end[];
      pfunc *p;

      initialized = 1;
      for (p = __ctors_end; p > __ctors; )
	(*--p) ();

    }
}