2010-08-30 03:57:37 +02:00
|
|
|
/* crt0.c
|
2003-05-12 13:06:27 +02:00
|
|
|
|
2010-08-30 03:57:37 +02:00
|
|
|
Copyright 2001, 2005, 2010 Red Hat, Inc.
|
2003-05-12 13:06:27 +02:00
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
/* In the following ifdef'd i386 code, the FPU precision is set to 80 bits
|
|
|
|
and all FPU exceptions are masked. The former is needed to make long
|
|
|
|
doubles work correctly. The latter causes the FPU to generate NaNs and
|
2010-08-30 03:57:37 +02:00
|
|
|
Infinities instead of signals for certain operations. */
|
2003-05-12 13:06:27 +02:00
|
|
|
|
2010-08-30 03:57:37 +02:00
|
|
|
#include "winlean.h"
|
|
|
|
#include <sys/cygwin.h>
|
winsup/cygwin/ChangeLog:
* Makefile.in (DLL_OFILES): Add new fenv.o module.
(fenv_CFLAGS): New flags definition for fenv.o compile.
* autoload.cc (std_dll_init): Use fenv.h functions instead of direct
manipulation of x87 FPU registers.
* crt0.c (mainCRTStartup): Likewise.
* cygwin.din (feclearexcept, fegetexceptflag, feraiseexcept,
fesetexceptflag, fetestexcept, fegetround, fesetround, fegetenv,
feholdexcept, fesetenv, feupdateenv, fegetprec, fesetprec,
feenableexcept, fedisableexcept, fegetexcept, _feinitialise,
_fe_dfl_env, _fe_nomask_env): Export new functions and data items.
* fenv.cc: New file.
* posix.sgml: Update status of newly-implemented APIs.
* include/fenv.h: Likewise related header.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-09-11 08:53:28 +02:00
|
|
|
#include "fenv.h"
|
2003-05-12 13:06:27 +02:00
|
|
|
|
|
|
|
extern int main (int argc, char **argv);
|
|
|
|
|
2003-08-06 03:40:12 +02:00
|
|
|
void cygwin_crt0 (int (*main) (int, char **));
|
|
|
|
|
2003-05-12 13:06:27 +02:00
|
|
|
void
|
|
|
|
mainCRTStartup ()
|
|
|
|
{
|
|
|
|
#ifdef __i386__
|
2004-05-04 16:46:25 +02:00
|
|
|
(void)__builtin_return_address(1);
|
|
|
|
asm volatile ("andl $-16,%%esp" ::: "%esp");
|
winsup/cygwin/ChangeLog:
* Makefile.in (DLL_OFILES): Add new fenv.o module.
(fenv_CFLAGS): New flags definition for fenv.o compile.
* autoload.cc (std_dll_init): Use fenv.h functions instead of direct
manipulation of x87 FPU registers.
* crt0.c (mainCRTStartup): Likewise.
* cygwin.din (feclearexcept, fegetexceptflag, feraiseexcept,
fesetexceptflag, fetestexcept, fegetround, fesetround, fegetenv,
feholdexcept, fesetenv, feupdateenv, fegetprec, fesetprec,
feenableexcept, fedisableexcept, fegetexcept, _feinitialise,
_fe_dfl_env, _fe_nomask_env): Export new functions and data items.
* fenv.cc: New file.
* posix.sgml: Update status of newly-implemented APIs.
* include/fenv.h: Likewise related header.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-09-11 08:53:28 +02:00
|
|
|
_feinitialise ();
|
2003-05-12 13:06:27 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
cygwin_crt0 (main);
|
2010-08-30 03:57:37 +02:00
|
|
|
|
|
|
|
/* These are never actually called. They are just here to force the inclusion
|
|
|
|
of things like -lbinmode. */
|
|
|
|
|
|
|
|
cygwin_premain0 (0, NULL, NULL);
|
|
|
|
cygwin_premain1 (0, NULL, NULL);
|
|
|
|
cygwin_premain2 (0, NULL, NULL);
|
|
|
|
cygwin_premain3 (0, NULL, NULL);
|
2003-05-12 13:06:27 +02:00
|
|
|
}
|
2005-09-29 16:28:22 +02:00
|
|
|
|
|
|
|
void WinMainCRTStartup(void) __attribute__ ((alias("mainCRTStartup")));
|