Fix stub of sockets for EMSCRIPTEN and XROS
Summary: The current implementation of function stubs in `SocketFileDescriptorMap.cpp` generates the following build errors: ``` stderr: xplat/folly/net/detail/SocketFileDescriptorMap.cpp:171:3: error: 'socketToFd' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions] throw std::logic_error("Not implemented!"); ^ xplat/folly/net/detail/SocketFileDescriptorMap.cpp:170:30: note: function declared non-throwing here int SocketFileDescriptorMap::socketToFd(void* sock) noexcept { ``` because the methods are stubbed out to throw and exception even though they are marked as `noexcept`. To fix the warning the subbing implementation is changed to call `std::terminate()` instead of throwing an exception. According to the language specification (https://en.cppreference.com/w/cpp/language/noexcept_spec) this should not result in any change in run-time behavior, since throwing and exception in a method marked as `noexcept` is effectively a call to `std::terminate()`. Differential Revision: D29687674 fbshipit-source-id: 77405d8a31e45c8836e8746c9b25e12ef06335c4
Showing
Please register or sign in to comment