From d3384178942afa12bcae41095e0199b79d25e08b Mon Sep 17 00:00:00 2001 From: arthurhsu Date: Tue, 26 Jul 2011 17:07:40 +0000 Subject: Fix crash issue when users specify /GR- in VC's compilation flag. --- cpp/src/sfntly/port/type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/sfntly/port/type.h b/cpp/src/sfntly/port/type.h index bb51993..4691a82 100644 --- a/cpp/src/sfntly/port/type.h +++ b/cpp/src/sfntly/port/type.h @@ -81,10 +81,10 @@ inline To down_cast(From* f) { // so we only accept pointers #pragma warning(pop) #endif -// The following code is the only place for RTTI. It is done so to allow VC++ -// to perform additional type checking in DEBUG builds. -#if defined (_MSC_VER) && !defined(NDEBUG) - assert(f == NULL || dynamic_cast(f) != NULL); // RTTI: debug mode only! +// The following code is the only place for RTTI. It is done so to allow +// additional type checking when SFNTLY_TYPE_VERIFICATION is defined. +#if defined (SFNTLY_TYPE_VERIFICATION) + assert(f == NULL || dynamic_cast(f) != NULL); #endif return static_cast(f); } -- cgit v1.2.3