home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / crt0 / _main.c next >
Encoding:
C/C++ Source or Header  |  1995-11-24  |  524 b   |  20 lines

  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.