Don't use RTTI in down_cast if GOOGLE_PROTOBUF_NO_RTTI is defined. Patch from Chris Masone (of Google).

pull/3335/head
kenton@google.com 16 years ago
parent 8169c7fcde
commit 0bcfeb9dcd
  1. 2
      src/google/protobuf/stubs/common.h

@ -283,7 +283,9 @@ inline To down_cast(From* f) { // so we only accept pointers
implicit_cast<From*, To>(0);
}
#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI)
assert(f == NULL || dynamic_cast<To>(f) != NULL); // RTTI: debug mode only!
#endif
return static_cast<To>(f);
}

Loading…
Cancel
Save