diff options
author | arthurhsu <arthurhsu@google.com> | 2011-07-26 17:07:40 +0000 |
---|---|---|
committer | arthurhsu <arthurhsu@google.com> | 2011-07-26 17:07:40 +0000 |
commit | d3384178942afa12bcae41095e0199b79d25e08b (patch) | |
tree | 4fa7591e1691c33a2190d6103c36432695674ce4 | |
parent | 299c9e780990183bf4d6e318e7ea0f882123cf1d (diff) | |
download | sfntly-d3384178942afa12bcae41095e0199b79d25e08b.tar.gz |
Fix crash issue when users specify /GR- in VC's compilation flag.
-rw-r--r-- | cpp/src/sfntly/port/type.h | 8 |
1 files 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<To>(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<To>(f) != NULL); #endif return static_cast<To>(f); } |