From: root AT jacob DOT remcomp DOT fr (root) Subject: Re: Exception Handling under mingw32 25 Jun 1997 13:59:50 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Content-Type: text Original-To: mannan AT mjolner DOT dk (Manmathan Muthukumarapillai) Original-Cc: gnu-win32 AT cygnus DOT com In-Reply-To: <33B15618.5326@mjolner.dk> from "Manmathan Muthukumarapillai" at Jun 25, 97 07:32:08 pm Original-Sender: owner-gnu-win32 AT cygnus DOT com > > Hello Everybody, > > 1) VERY IMPORTANT > Since Microsoft's Structured Exception Handling is not supported under > mingw32 (gnu-win32), is there any other ways to do exception handling in > this enviroment? Easy: You have to insert your exception handling routine at the linked list of exception routines. Just insert it at fs:0, and in the 'next' field put the old value in fs:0. For the details see 'Microsoft Systems Journal', january I think. There Matt pietreck explains how to do it. > > 2) > Is it maybe possible to compile some C-code in which there is used > Microsoft's Structured Exception Handling with MS's "CL" and then link > it to gether with other objektfiles generated by gcc, ofcource I want to > link the files together with ld/gcc and not with MS's LINK.EXE and not > using Microsoft copyrighted libraryfiles. You will have to write the exception handler catching routine. When an exception happens, the system goes into that list at fs:0, and will call the routine you specified. Microsoft's one is called exception_handler3 (or something similar). If the code uses Microsoft's exception handler, you will get an undefined reference to that routine. Again, I recommend to all people interested to read Microsoft Systems Journal. I hope I got the exact month OK, but I could be wrong by + or - one month... typical programmer error! > (The thing is that I want to distribute some librarys with objectfiles > which the users (who do not have MS VC40) can use to link together with > there own objectfiles) To see an implementation of structured exception handler look at the code seh.c in the lcc-win32 distribution. It is binary compatible with MSVC. -- Jacob Navia Logiciels/Informatique 41 rue Maurice Ravel Tel 01 48.23.51.44 93430 Villetaneuse Fax 01 48.23.95.39 France - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".