catch (...)
Ross Johnson
rpj@ise.canberra.edu.au
Tue Aug 7 20:52:00 GMT 2001
reentrant wrote:
>
> > #define PtW32CatchAll \
> > catch( ptw32_exception & ) { throw; } \
> > catch( ... )
>
> Seems like it might be more appropriate (possibly required by the pthread
> standard?) for this to have a prefix of "pthread_" and a suffix of "_np" for
> non-portable; potentially "pthread_w32_catch_all_np" or similar instead of
> ? The same holds true for other PtW32 prefixed items. It
> seems wrong to introduce another namespace.
>
You are probably right. If I recall correctly, it was
given a Win32 style name because it is Win32 specific
AND specific to MSVC++. Another weak argument for not putting
it into the _np namespace is that it's a macro standing
in for a compiler keyword rather than imitating a function.
Anyway, changing it now would require people to change their
code.
It can be used portably as follows:
#ifdef PtW32CatchAll
PtW32CatchAll
#else
catch(...)
#endif
{
// Exception handler of last resort
}
Or avoid all of this added complexity if you can by using
the plain vanilla C version of the library named pthreadVC.dll
which doesn't use exceptions internally.
Ross
More information about the Pthreads-win32
mailing list