فهرست منبع

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

kenton@google.com 16 سال پیش
والد
کامیت
0bcfeb9dcd
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/google/protobuf/stubs/common.h

+ 2 - 0
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);
 }