Commit 2a0c9d06 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 3

More fixup of the build on Mac for HHVM

Summary: `std::__throw_bad_alloc()` is defined in `<new>` on OSX, so bring back the `#ifdef` guards that were there previously.

Reviewed By: markw65

Differential Revision: D3749714

fbshipit-source-id: 0338a4cece928fce0b9d33d41c17cfa99a319abe
parent 572543f4
...@@ -33,9 +33,11 @@ void __throw_out_of_range(const char* msg) { ...@@ -33,9 +33,11 @@ void __throw_out_of_range(const char* msg) {
throw std::out_of_range(msg); throw std::out_of_range(msg);
} }
#ifdef _MSC_VER
void __throw_bad_alloc() { void __throw_bad_alloc() {
throw std::bad_alloc(); throw std::bad_alloc();
} }
#endif
FOLLY_NAMESPACE_STD_END FOLLY_NAMESPACE_STD_END
#endif #endif
...@@ -21,13 +21,17 @@ ...@@ -21,13 +21,17 @@
#if FOLLY_HAVE_BITS_FUNCTEXCEPT_H #if FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <bits/functexcept.h> #include <bits/functexcept.h>
#else #else
#include <new> // Some platforms define __throw_bad_alloc() here.
#include <folly/Portability.h> #include <folly/Portability.h>
FOLLY_NAMESPACE_STD_BEGIN FOLLY_NAMESPACE_STD_BEGIN
[[noreturn]] void __throw_length_error(const char* msg); [[noreturn]] void __throw_length_error(const char* msg);
[[noreturn]] void __throw_logic_error(const char* msg); [[noreturn]] void __throw_logic_error(const char* msg);
[[noreturn]] void __throw_out_of_range(const char* msg); [[noreturn]] void __throw_out_of_range(const char* msg);
#ifdef _MSC_VER
[[noreturn]] void __throw_bad_alloc(); [[noreturn]] void __throw_bad_alloc();
#endif
FOLLY_NAMESPACE_STD_END FOLLY_NAMESPACE_STD_END
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment