- Take in account also that pain in the ass that is MSVC++ on win32

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1190 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-16 12:57:03 +00:00
parent f174524b1e
commit 74a2d8ff91
1 changed files with 7 additions and 4 deletions

View File

@ -22,9 +22,7 @@
#ifndef DOWN_CAST_TCC
#define DOWN_CAST_TCC 1
#include <functional>
#ifndef NDEBUG
#if (not defined NDEBUG) && (not defined _MSC_VER)
#include <sys/types.h>
#include <iostream>
#include <signal.h>
@ -81,6 +79,7 @@ namespace sgpem
inline To& operator()(From& obj) const
{
#ifndef NDEBUG
#ifndef _MSC_VER
try
{
return dynamic_cast<To&>(obj);
@ -95,6 +94,10 @@ namespace sgpem
kill(me, SIGSTOP);
throw;
}
#else
// For MSVC++ on Win32
return dynamic_cast<To&>(obj);
#endif
#else
return static_cast<To&>(obj);
#endif
@ -110,7 +113,7 @@ namespace sgpem
template<typename From>
inline To* operator()(From* obj) const
{
#ifndef NDEBUG
#if (not defined NDEBUG) && (not defined _MSC_VER)
To* check_ptr = dynamic_cast<To*>(obj);
if(check_ptr == NULL)
{