mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
- Cleanup the /lib directory, by putting more 3rd-party libs in /3rdparty, and by creating a new directory called /sdk where libraries which emulate the ones in the WDK are present (Such as uuid, nt, crt, etc).
- Removed lib/interlck and lib/string. - Removed math routines from lib/rtl. - Created a new library called libcntpr which is what NT/WDK use when compiling the kernel/system libraries. This is an "NT-Private" version of the CRT which is supposed to contain what we had in lib/string and lib/rtl. svn path=/trunk/; revision=26095
This commit is contained in:
parent
e4cfaf284e
commit
85985d712e
629 changed files with 27340 additions and 7038 deletions
79
reactos/lib/3rdparty/mingw/gccmain.c
vendored
Normal file
79
reactos/lib/3rdparty/mingw/gccmain.c
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* gccmain.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* A separate version of __main, __do_global_ctors and __do_global_dtors for
|
||||
* Mingw32 for use with Cygwin32 b19. Hopefully this object file will only
|
||||
* be linked if the libgcc.a doesn't include __main, __do_global_dtors and
|
||||
* __do_global_ctors.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Needed for the atexit prototype. */
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef void (*func_ptr) (void);
|
||||
extern func_ptr __CTOR_LIST__[];
|
||||
extern func_ptr __DTOR_LIST__[];
|
||||
|
||||
void
|
||||
__do_global_dtors (void)
|
||||
{
|
||||
static func_ptr *p = __DTOR_LIST__ + 1;
|
||||
|
||||
/*
|
||||
* Call each destructor in the destructor list until a null pointer
|
||||
* is encountered.
|
||||
*/
|
||||
while (*p)
|
||||
{
|
||||
(*(p)) ();
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__do_global_ctors (void)
|
||||
{
|
||||
unsigned long nptrs = (unsigned long) __CTOR_LIST__[0];
|
||||
unsigned i;
|
||||
|
||||
/*
|
||||
* If the first entry in the constructor list is -1 then the list
|
||||
* is terminated with a null entry. Otherwise the first entry was
|
||||
* the number of pointers in the list.
|
||||
*/
|
||||
if (nptrs == -1)
|
||||
{
|
||||
for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++)
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go through the list backwards calling constructors.
|
||||
*/
|
||||
for (i = nptrs; i >= 1; i--)
|
||||
{
|
||||
__CTOR_LIST__[i] ();
|
||||
}
|
||||
|
||||
/*
|
||||
* Register the destructors for processing on exit.
|
||||
*/
|
||||
atexit (__do_global_dtors);
|
||||
}
|
||||
|
||||
static int initialized = 0;
|
||||
|
||||
void
|
||||
__main (void)
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = 1;
|
||||
__do_global_ctors ();
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue