Add MSVC support to Singleton's fatalHelper
authorOrvid King <blah38621@gmail.com>
Wed, 29 Jul 2015 21:51:04 +0000 (14:51 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Wed, 29 Jul 2015 22:22:18 +0000 (15:22 -0700)
Summary: MSVC doesn't support constructor priorities, so use the same code as OSX.
Closes #272

Reviewed By: @yfeldblum

Differential Revision: D2283998

Pulled By: @sgolemon

folly/Singleton.cpp

index a9ca67f6d2d2f676c643b7a1f68bfd4724357692..1029097146aa295c0b6633ebcfd5ac328eb8bfc0 100644 (file)
@@ -45,7 +45,7 @@ struct FatalHelper {
   std::vector<detail::TypeDescriptor> leakedSingletons_;
 };
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_MSC_VER)
 // OS X doesn't support constructor priorities.
 FatalHelper fatalHelper;
 #else