From d7bda3ad6381aaf33c8cac584654b35eceb1301c Mon Sep 17 00:00:00 2001 From: Elizabeth Smith Date: Tue, 13 May 2014 08:15:07 -0700 Subject: [PATCH] missing exception Summary: windows is also missing __throw_bad_alloc Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D1318921 --- folly/detail/FunctionalExcept.cpp | 6 ++++++ folly/detail/FunctionalExcept.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/folly/detail/FunctionalExcept.cpp b/folly/detail/FunctionalExcept.cpp index f17879a7..e78841a7 100644 --- a/folly/detail/FunctionalExcept.cpp +++ b/folly/detail/FunctionalExcept.cpp @@ -32,4 +32,10 @@ void __throw_out_of_range(const char* msg) { throw std::out_of_range(msg); } +#if defined(_MSC_VER) +void __throw_bad_alloc() { + throw std::bad_alloc(); +} +#endif + FOLLY_NAMESPACE_STD_END diff --git a/folly/detail/FunctionalExcept.h b/folly/detail/FunctionalExcept.h index 1aaecebe..e328617b 100644 --- a/folly/detail/FunctionalExcept.h +++ b/folly/detail/FunctionalExcept.h @@ -25,6 +25,10 @@ FOLLY_NORETURN void __throw_length_error(const char* msg); FOLLY_NORETURN void __throw_logic_error(const char* msg); FOLLY_NORETURN void __throw_out_of_range(const char* msg); +#ifdef _MSC_VER +FOLLY_NORETURN void __throw_bad_alloc(); +#endif + FOLLY_NAMESPACE_STD_END #endif -- 2.34.1