Subversion Repositories Kolibri OS

Rev

Rev 4872 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. extern void _pei386_runtime_relocator (void);
  3.  
  4. typedef void (*ctp)();
  5. static void __do_global_ctors ()
  6. {
  7.   extern int __CTOR_LIST__;
  8.   int *c = &__CTOR_LIST__;
  9.   c++;
  10.   while (*c)
  11.     {
  12.       ctp d = (ctp)*c;
  13.       (d)();
  14.       c++;
  15.     }
  16. }
  17.  
  18. int __attribute__((externally_visible)) DllStartup(void *module, int reason)
  19. {
  20.     if(reason == 1)
  21.     {
  22.         _pei386_runtime_relocator();
  23.         __do_global_ctors();
  24.     };
  25.  
  26.     return 1;
  27. };
  28.