Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2004-08-24 12:49:33 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2004-08-24 12:49:33 +0400
commit45b1139e413d3939436dac636991a5bbbfd7e9ad (patch)
tree29afe6c246ff014395f62ee0b7569881ef3f9426 /winsup
parentef642316f6240ec273c08418845e2d2b5671e84a (diff)
* crt1.c: (__mingw_CRTStartup): Change return to void. Add
noreturn attribute. Align stack to 16 bytes before passing args to main. (mainCRTStartup): Change return to void. (WinMainCRTStartup): Likewise.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/mingw/ChangeLog9
-rw-r--r--winsup/mingw/crt1.c31
2 files changed, 22 insertions, 18 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index 56ae97646..f6f506364 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-24 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * crt1.c: (__mingw_CRTStartup): Change return to void. Add
+ noreturn attribute. Align stack to 16 bytes before passing args
+ to main.
+ (mainCRTStartup): Change return to void.
+ (WinMainCRTStartup): Likewise.
+
+
2004-08-15 Danny Smith <dannysmith@users.sourceforge.net>
* profile/COPYING: New file.
diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c
index 21c54d6b2..780b75e5a 100644
--- a/winsup/mingw/crt1.c
+++ b/winsup/mingw/crt1.c
@@ -9,10 +9,8 @@
*
*/
-/* Hide the declaration of _fmode with dllimport attribute in stdlib.h.
- This is not necessary with Mumit Khan's patches to gcc's winnt.c,
- but those patches are still unofficial. */
-
+/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to
+ avoid problems with older GCC. */
#define __IN_MINGW_RUNTIME
#include <stdlib.h>
#include <stdio.h>
@@ -30,7 +28,6 @@
* a-good-idea use of include. */
#include "init.c"
-
extern void _pei386_runtime_relocator (void);
extern int main (int, char **, char **);
@@ -62,7 +59,7 @@ extern int* __p__fmode(void); /* To access the dll _fmode */
extern int _CRT_fmode;
static void
-_mingw32_init_fmode ()
+_mingw32_init_fmode (void)
{
/* Don't set the std file mode if the user hasn't set any value for it. */
if (_CRT_fmode)
@@ -96,7 +93,6 @@ _mingw32_init_fmode ()
#else
*_imp___fmode_dll = _fmode;
#endif
-
}
/* This function will be called when a trap occurs. Thanks to Jacob
@@ -164,8 +160,8 @@ _gnu_exception_handler (EXCEPTION_POINTERS * exception_data)
/*
* The function mainCRTStartup is the entry point for all console programs.
*/
-static int
-__mingw_CRTStartup ()
+static void __attribute__((noreturn))
+__mingw_CRTStartup (void)
{
int nRet;
@@ -194,11 +190,14 @@ __mingw_CRTStartup ()
* NOTE: DLLs don't do this because that would be rude!
*/
_mingw32_init_fmode ();
-
/* Adust references to dllimported data that have non-zero offsets. */
_pei386_runtime_relocator ();
+ /* Align the stack to 16 bytes for the sake of SSE ops in main
+ or in functions inlined into main. */
+ asm __volatile__ ("andl $-16, %%esp" : : : "%esp");
+
/*
* Call the main function. If the user does not supply one
* the one in the 'libmingw32.a' library will be linked in, and
@@ -214,21 +213,18 @@ __mingw_CRTStartup ()
_cexit ();
ExitProcess (nRet);
-
- return 0;
}
/*
* The function mainCRTStartup is the entry point for all console programs.
*/
-int
-mainCRTStartup ()
+void
+mainCRTStartup (void)
{
#ifdef __MSVCRT__
__set_app_type (__CONSOLE_APP);
#endif
__mingw_CRTStartup ();
- return 0;
}
/*
@@ -236,14 +232,13 @@ mainCRTStartup ()
* This simply gets rid of the annoying warning about not being able
* to find WinMainCRTStartup when linking GUI applications.
*/
-int
-WinMainCRTStartup ()
+void
+WinMainCRTStartup (void)
{
#ifdef __MSVCRT__
__set_app_type (__GUI_APP);
#endif
__mingw_CRTStartup ();
-return 0;
}
/*