diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-08-14 01:21:01 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-08-14 01:21:01 +0000 |
commit | 0bcfeb9dcd0885e37cda8b209209c18c9822a481 (patch) | |
tree | ee897b06bda896ae59bb01579a967d8415d271e7 | |
parent | 8169c7fcde43861e4f55f5491f2b0c9ec367147b (diff) | |
download | protobuf-0bcfeb9dcd0885e37cda8b209209c18c9822a481.tar.gz protobuf-0bcfeb9dcd0885e37cda8b209209c18c9822a481.tar.bz2 protobuf-0bcfeb9dcd0885e37cda8b209209c18c9822a481.zip |
Don't use RTTI in down_cast if GOOGLE_PROTOBUF_NO_RTTI is defined. Patch from Chris Masone (of Google).
-rw-r--r-- | src/google/protobuf/stubs/common.h | 2 |
1 files changed, 2 insertions, 0 deletions
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<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); } |