From 0bcfeb9dcd0885e37cda8b209209c18c9822a481 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Fri, 14 Aug 2009 01:21:01 +0000 Subject: Don't use RTTI in down_cast if GOOGLE_PROTOBUF_NO_RTTI is defined. Patch from Chris Masone (of Google). --- src/google/protobuf/stubs/common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index c789a776..3f002373 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -283,7 +283,9 @@ inline To down_cast(From* f) { // so we only accept pointers implicit_cast(0); } +#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI) assert(f == NULL || dynamic_cast(f) != NULL); // RTTI: debug mode only! +#endif return static_cast(f); } -- cgit v1.2.3