diff --git a/src/backend/sgpemv2/templates/down_cast.tcc b/src/backend/sgpemv2/templates/down_cast.tcc index 2453fdb..73dc81a 100644 --- a/src/backend/sgpemv2/templates/down_cast.tcc +++ b/src/backend/sgpemv2/templates/down_cast.tcc @@ -22,9 +22,7 @@ #ifndef DOWN_CAST_TCC #define DOWN_CAST_TCC 1 -#include - -#ifndef NDEBUG +#if (not defined NDEBUG) && (not defined _MSC_VER) #include #include #include @@ -81,6 +79,7 @@ namespace sgpem inline To& operator()(From& obj) const { #ifndef NDEBUG + #ifndef _MSC_VER try { return dynamic_cast(obj); @@ -95,6 +94,10 @@ namespace sgpem kill(me, SIGSTOP); throw; } + #else + // For MSVC++ on Win32 + return dynamic_cast(obj); + #endif #else return static_cast(obj); #endif @@ -110,7 +113,7 @@ namespace sgpem template inline To* operator()(From* obj) const { -#ifndef NDEBUG +#if (not defined NDEBUG) && (not defined _MSC_VER) To* check_ptr = dynamic_cast(obj); if(check_ptr == NULL) {