Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/internal.h>
  3. #include <libc/bss.h>
  4.  
  5. typedef void (*FUNC)(void);
  6. extern FUNC djgpp_first_ctor[] __asm__("djgpp_first_ctor");
  7. extern FUNC djgpp_last_ctor[] __asm__("djgpp_last_ctor");
  8.  
  9. void
  10. __main(void)
  11. {
  12.   static int been_there_done_that = -1;
  13.   int i;
  14.   if (been_there_done_that == __bss_count)
  15.     return;
  16.   been_there_done_that = __bss_count;
  17.   for (i=0; i<djgpp_last_ctor-djgpp_first_ctor; i++)
  18.     djgpp_first_ctor[i]();
  19. }
  20.