Add detection of MSVC RTTI
authorOrvid King <blah38621@gmail.com>
Tue, 28 Jul 2015 21:09:55 +0000 (14:09 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Tue, 28 Jul 2015 22:22:12 +0000 (15:22 -0700)
Summary: This adds MSVC support to the detection of FOLLY_HAS_RTTI.
Closes #255

Reviewed By: @yfeldblum

Differential Revision: D2283036

Pulled By: @sgolemon

folly/Portability.h

index 40a626038e688d751aa77eb16ea1115c73a699ee..0e8e11082c86daa80291a8f7d10aacbdcde60f66 100644 (file)
@@ -280,7 +280,8 @@ inline size_t malloc_usable_size(void* ptr) {
 #endif
 
 // RTTI may not be enabled for this compilation unit.
-#if defined(__GXX_RTTI) || defined(__cpp_rtti)
+#if defined(__GXX_RTTI) || defined(__cpp_rtti) || \
+    (defined(_MSC_VER) && defined(_CPPRTTI))
 # define FOLLY_HAS_RTTI 1
 #endif