This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: catch (...)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]