2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
11 typedef void (*func_ptr
) (void);
12 extern func_ptr __CTOR_LIST__
[];
13 extern func_ptr __DTOR_LIST__
[];
15 void __do_global_dtors (void);
16 void __do_global_ctors (void);
20 __do_global_dtors (void)
22 static func_ptr
*p
= __DTOR_LIST__
+ 1;
32 __do_global_ctors (void)
34 unsigned long nptrs
= (unsigned long) (ptrdiff_t) __CTOR_LIST__
[0];
37 if (nptrs
== (unsigned long) -1)
39 for (nptrs
= 0; __CTOR_LIST__
[nptrs
+ 1] != 0; nptrs
++);
42 for (i
= nptrs
; i
>= 1; i
--)
47 atexit (__do_global_dtors
);
50 static int initialized
= 0;