Commit 8e13f6e0 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 7

Move detail/FunctionalExcept to portability/BitsFunctexcept

Summary: Because it is a portability header, but was created before portability headers were cool.

Reviewed By: mzlee

Differential Revision: D3743475

fbshipit-source-id: 5d2fe23ce08f0425ce48b4871fa660e69f57cc39
parent 5e96c615
......@@ -59,7 +59,6 @@ nobase_follyinclude_HEADERS = \
detail/ExceptionWrapper.h \
detail/FileUtilDetail.h \
detail/FingerprintPolynomial.h \
detail/FunctionalExcept.h \
detail/Futex.h \
detail/GroupVarintDetail.h \
detail/IPAddress.h \
......@@ -267,6 +266,7 @@ nobase_follyinclude_HEADERS = \
Portability.h \
portability/Asm.h \
portability/Atomic.h \
portability/BitsFunctexcept.h \
portability/Builtins.h \
portability/Config.h \
portability/Constexpr.h \
......@@ -437,6 +437,7 @@ libfolly_la_SOURCES = \
detail/SocketFastOpen.cpp \
MacAddress.cpp \
MemoryMapping.cpp \
portability/BitsFunctexcept.cpp \
portability/Dirent.cpp \
portability/Environment.cpp \
portability/Fcntl.cpp \
......
......@@ -20,6 +20,8 @@
#pragma once
#define FOLLY_MALLOC_H_
#include <folly/portability/BitsFunctexcept.h>
/**
* Define various MALLOCX_* macros normally provided by jemalloc. We define
* them so that we don't have to include jemalloc.h, in case the program is
......@@ -85,7 +87,6 @@ extern "C" int mallctlbymib(const size_t*, size_t, void*, size_t*, void*,
size_t)
__attribute__((__weak__));
#include <bits/functexcept.h>
#define FOLLY_HAVE_MALLOC_H 1
#else
#include <folly/detail/Malloc.h> /* nolint */
......
......@@ -238,13 +238,6 @@ namespace std { typedef ::max_align_t max_align_t; }
# define FOLLY_GLIBCXX_NAMESPACE_CXX11_END
#endif
// Provide our own std::__throw_* wrappers for platforms that don't have them
#if FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <bits/functexcept.h>
#else
#include <folly/detail/FunctionalExcept.h>
#endif
// MSVC specific defines
// mainly for posix compat
#ifdef _MSC_VER
......
......@@ -14,15 +14,9 @@
* limitations under the License.
*/
#include <folly/Portability.h>
// If FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set, this file compiles to
// nothing.
#include <folly/portability/BitsFunctexcept.h>
#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <folly/detail/FunctionalExcept.h>
#include <stdexcept>
FOLLY_NAMESPACE_STD_BEGIN
......@@ -39,12 +33,9 @@ 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
#endif
......@@ -16,22 +16,18 @@
#pragma once
#include <folly/Portability.h>
#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <folly/portability/Config.h>
#if FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <bits/functexcept.h>
#else
#include <folly/Portability.h>
FOLLY_NAMESPACE_STD_BEGIN
[[noreturn]] void __throw_length_error(const char* msg);
[[noreturn]] void __throw_logic_error(const char* msg);
[[noreturn]] void __throw_out_of_range(const char* msg);
#ifdef _MSC_VER
[[noreturn]] void __throw_bad_alloc();
#endif
FOLLY_NAMESPACE_STD_END
#else
#error This file should never be included if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set
#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