This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Ada: MinGW32 path to ada/init.c
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 Dec 2001 08:03:45 +1100 (EST)
- Subject: Ada: MinGW32 path to ada/init.c
Hello
In ada/init.c, the top level exception filter under win32 needs to have
__stdcall calling convention or stack corruption will occur. You may
confirm by checking the prototype of SetUnhandledExceptionFilter in
the win32api headers (winbase.h).
ChangeLog
2001-12-18 Danny Smith <dannysmith@users.sourceforge.net>
* ada/init.c (__gnat_error_handler): Make __stdcall.
Const-ify char* msg.
Index: init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/init.c,v
retrieving revision 1.8
diff -u -p -r1.8 init.c
--- init.c 2001/12/16 01:13:42 1.8
+++ init.c 2001/12/18 20:22:24
@@ -676,17 +676,18 @@ __gnat_initialize ()
#elif defined (__MINGW32__)
#include <windows.h>
-static LONG __gnat_error_handler PARAMS ((PEXCEPTION_POINTERS));
+/* In Win32 the top level error filter must use __stdcall convention. */
+static LONG CALLBACK __gnat_error_handler PARAMS ((PEXCEPTION_POINTERS));
/* __gnat_initialize (mingw32). */
-static LONG
+static LONG CALLBACK
__gnat_error_handler (info)
PEXCEPTION_POINTERS info;
{
static int recurse;
struct Exception_Data *exception;
- char *msg;
+ const char *msg;
switch (info->ExceptionRecord->ExceptionCode)
{
http://greetings.yahoo.com.au - Yahoo! Greetings
- Send your festive greetings online!