On 2009.09.22 at 12:13:45 +0200, Ger Hobbelt via RT wrote:

> Sorry for late reply; been under the weather lately, healthwise, so
> this is my first 'on-line' experience in a while ;-)
> 
> As far as the brain is operational again... I'd say the quickest way
> to fix this is to wrap the __try/__except chunk in a compiler-specific
> preproc check a la:
> 
> #if defined(_MSC_VER)
> __try
> ...
> __except
> ...
> #endif
> 
> No use doing #else branches for that one, as the alternatives are:
> 
> 
> - I don't think mingw et al have something equivalent to offer anyhow,
> unless they've come up with some harebrained signal/sigaction scheme
> of their own instead. Allow me to cringe if they have.
 
Mingw does. It have header except.h, which defines __try1 and __except1
which do some assembler black magic. 

Unfortunately I don't know windows internals enough to tell from the
glance if this magic correct or not. So, I haven't tried to use
them in RAND_poll.c. If somebody would provide me a test program which
reproducibly generates a SEH, I would give it a try.

Really, mingw compiling for Win32 have some advantages and it is no
a good idea to drop mingw support entirely (which is effectively done
with this "fix").

1. You don't need windows to build something with mingw. If you are
developing cross-platform applications, you can compile for all
platforms on the same machine.

2. You don't have to mess with zillion of versions of msvcrXX.dll
Even newest versions of mingw32 compile binaries, which use msvcrt.dll,
regardless of debug or release mode,
which is compatible with every newer version of MS compiler, and present
in every Windows since NT 4.0 at least. So you don't have to include
runtime DLLs into your installation package.

3. It's free as free speech.

> - The choice to 'roll your own' I would strongly advise to stay the
> hell away from; for a hint of what it might take for starters, see
>   http://www.microsoft.com/msj/0197/Exception/Exception.aspx
> 
> 
> So unless someone can teach me the error of my current ways regarding
> SEH and gcc on Win32/64, I'd say that __try/__except encased section

Really, mingw have define SEHNOOP, which makes __try and __except empty.
But it is not a good thing, because it doesn't actually catch an
exception. But for now I use it for my mingw cross-builds.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to