aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarthurhsu <arthurhsu@google.com>2011-07-26 17:07:40 +0000
committerarthurhsu <arthurhsu@google.com>2011-07-26 17:07:40 +0000
commitd3384178942afa12bcae41095e0199b79d25e08b (patch)
tree4fa7591e1691c33a2190d6103c36432695674ce4
parent299c9e780990183bf4d6e318e7ea0f882123cf1d (diff)
downloadsfntly-d3384178942afa12bcae41095e0199b79d25e08b.tar.gz
Fix crash issue when users specify /GR- in VC's compilation flag.
-rw-r--r--cpp/src/sfntly/port/type.h8
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);
}