Cygwin: strptime: add release note
[newlib-cygwin.git] / winsup / cygwin / gcrt0.c
blobf02b3be593234cfa1c608068c1e5afd53ed8b032
1 /* gcrt0.c
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7 details. */
9 /*
10 * This file is taken from Cygwin distribution. Please keep it in sync.
11 * The differences should be within __MINGW32__ guard.
14 #include <sys/types.h>
15 #include <stdlib.h>
17 #ifdef __MINGW32__
18 #include <_bsd_types.h>
19 #endif
21 extern uint8_t etext asm ("etext");
22 extern uint8_t eprol asm ("__eprol");
23 extern void _mcleanup (void);
24 extern void monstartup (size_t, size_t);
25 void _monstartup (void) __attribute__((__constructor__));
27 /* startup initialization for -pg support */
29 void
30 _monstartup (void)
32 static int called;
34 /* Guard against multiple calls that may happen if DLLs are linked
35 with profile option set as well. Addede side benefit is that it
36 makes profiling backward compatible (GCC used to emit a call to
37 _monstartup when compiling main with profiling enabled). */
38 if (called++)
39 return;
41 monstartup ((size_t) &eprol, (size_t) &etext);
42 atexit (&_mcleanup);
45 asm (".text");
46 asm ("__eprol:");