Summary:Because sometimes things are just different.
MSVC warns about the `dynamic_cast` done against this class because the class's declaration doesn't show that it would need a vtordisp. While I don't believe the `dynamic_cast` in question is actually called in either the constructor or destructor paths for the class, better to be safe and force the disp to be created.
Reviewed By: yfeldblum
Differential Revision:
D2887490
Pulled By: Orvid
fb-gh-sync-id:
821a6fc820087ac7120fffd9f8b95a26c2b4e71b
shipit-source-id:
821a6fc820087ac7120fffd9f8b95a26c2b4e71b
* responding and no further progress can be made sending the data.
*/
+#ifdef _MSC_VER
+// We do a dynamic_cast on this, in
+// AsyncTransportWrapper::getUnderlyingTransport so be safe and
+// force displacements for it. See:
+// https://msdn.microsoft.com/en-us/library/7sf3txa8.aspx
+#pragma vtordisp(push, 2)
+#endif
class AsyncSocket : virtual public AsyncTransportWrapper {
public:
typedef std::unique_ptr<AsyncSocket, Destructor> UniquePtr;
BufferCallback* bufferCallback_{nullptr};
};
-
+#ifdef _MSC_VER
+#pragma vtordisp(pop)
+#endif
} // folly