detail/ExceptionWrapper.h \
detail/FileUtilDetail.h \
detail/FingerprintPolynomial.h \
- detail/FunctionalExcept.h \
detail/Futex.h \
detail/GroupVarintDetail.h \
detail/IPAddress.h \
Portability.h \
portability/Asm.h \
portability/Atomic.h \
+ portability/BitsFunctexcept.h \
portability/Builtins.h \
portability/Config.h \
portability/Constexpr.h \
detail/SocketFastOpen.cpp \
MacAddress.cpp \
MemoryMapping.cpp \
+ portability/BitsFunctexcept.cpp \
portability/Dirent.cpp \
portability/Environment.cpp \
portability/Fcntl.cpp \
#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
size_t)
__attribute__((__weak__));
-#include <bits/functexcept.h>
#define FOLLY_HAVE_MALLOC_H 1
#else
#include <folly/detail/Malloc.h> /* nolint */
# 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
+++ /dev/null
-/*
- * Copyright 2016 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <folly/Portability.h>
-
-// If FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set, this file compiles to
-// nothing.
-
-#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
-
-#include <folly/detail/FunctionalExcept.h>
-
-#include <stdexcept>
-
-FOLLY_NAMESPACE_STD_BEGIN
-
-void __throw_length_error(const char* msg) {
- throw std::length_error(msg);
-}
-
-void __throw_logic_error(const char* msg) {
- throw std::logic_error(msg);
-}
-
-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
+++ /dev/null
-/*
- * Copyright 2016 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <folly/Portability.h>
-
-#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_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
--- /dev/null
+/*
+ * Copyright 2016 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <folly/portability/BitsFunctexcept.h>
+
+#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
+#include <stdexcept>
+
+FOLLY_NAMESPACE_STD_BEGIN
+
+void __throw_length_error(const char* msg) {
+ throw std::length_error(msg);
+}
+
+void __throw_logic_error(const char* msg) {
+ throw std::logic_error(msg);
+}
+
+void __throw_out_of_range(const char* msg) {
+ throw std::out_of_range(msg);
+}
+
+void __throw_bad_alloc() {
+ throw std::bad_alloc();
+}
+
+FOLLY_NAMESPACE_STD_END
+#endif
--- /dev/null
+/*
+ * Copyright 2016 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#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);
+[[noreturn]] void __throw_bad_alloc();
+
+FOLLY_NAMESPACE_STD_END
+#endif