summarylogtreecommitdiffstats
path: root/crc32c-string-view-check.patch
diff options
context:
space:
mode:
authorJonas Heinrich2017-12-13 22:47:23 +0100
committerJonas Heinrich2017-12-13 22:47:23 +0100
commitac49deb3145c075a39e88510779260ea75e336c3 (patch)
tree14b8e1dca2eecd73184b4e385a348ad5dadf324f /crc32c-string-view-check.patch
parent63e4902779ee5c1a272a05fc1217e39cdf7d8794 (diff)
downloadaur-ac49deb3145c075a39e88510779260ea75e336c3.tar.gz
updated package to match a bit more the upstream version
Diffstat (limited to 'crc32c-string-view-check.patch')
-rw-r--r--crc32c-string-view-check.patch74
1 files changed, 0 insertions, 74 deletions
diff --git a/crc32c-string-view-check.patch b/crc32c-string-view-check.patch
deleted file mode 100644
index 9f53ec036e35..000000000000
--- a/crc32c-string-view-check.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From d0f929a5db87cb34d03afb0d8e8bfc95b8f786e3 Mon Sep 17 00:00:00 2001
-From: Victor Costan <costan@gmail.com>
-Date: Mon, 11 Sep 2017 13:18:27 -0700
-Subject: [PATCH] More conservative check for <string_view> availability. (#4)
-
-has_include(<string_view>) does not imply that the header can be
-included and will work. The assumption fails on MSVC and libc++ [1, 2].
-Conversely, checking that __cplusplus > 201402L is not sufficient on its
-own either, as the toolchain on Mac OS 10.12 passes that check but does
-not contain a <string_view> header.
-
-[1] https://crbug.com/759349
-[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433
----
- include/crc32c/crc32c.h | 10 +++-------
- src/crc32c_unittest.cc | 6 ++----
- 2 files changed, 5 insertions(+), 11 deletions(-)
-
-diff --git a/include/crc32c/crc32c.h b/include/crc32c/crc32c.h
-index 9f1973a..8ecab0d 100644
---- a/include/crc32c/crc32c.h
-+++ b/include/crc32c/crc32c.h
-@@ -33,22 +33,18 @@ inline uint32_t Crc32c(const std::string& string) {
- string.size());
- }
-
--#if defined(__has_include)
-+#if __cplusplus > 201402L
- #if __has_include(<string_view>)
--// Visual Studio provides a <string_view> header even in C++11 mode. When
--// included, the header issues an #error. (C1189)
--#if !defined(_MSC_VER) || __cplusplus >= 201703L
- #include <string_view>
-
--// Comptues the CRC32C of the bytes in the string_view.
-+// Computes the CRC32C of the bytes in the string_view.
- inline uint32_t Crc32c(const std::string_view& string_view) {
- return Crc32c(reinterpret_cast<const uint8_t*>(string_view.data()),
- string_view.size());
- }
-
--#endif // !defined(_MSC_VER) || __cplusplus >= 201703L
- #endif // __has_include(<string_view>)
--#endif // defined(__has_include)
-+#endif // __cplusplus > 201402L
-
- } // namespace crc32c
-
-diff --git a/src/crc32c_unittest.cc b/src/crc32c_unittest.cc
-index 7a9c765..69babb3 100644
---- a/src/crc32c_unittest.cc
-+++ b/src/crc32c_unittest.cc
-@@ -95,9 +95,8 @@ TEST(CRC32CTest, Crc32cStdString) {
- EXPECT_EQ(static_cast<uint32_t>(0x113fdb5c), crc32c::Crc32c(buf));
- }
-
--#if defined(__has_include)
-+#if __cplusplus > 201402L
- #if __has_include(<string_view>)
--#if !defined(_MSC_VER) || __cplusplus >= 201703L
-
- TEST(CRC32CTest, Crc32cStdStringView) {
- uint8_t buf[32];
-@@ -118,9 +117,8 @@ TEST(CRC32CTest, Crc32cStdStringView) {
- EXPECT_EQ(static_cast<uint32_t>(0x113fdb5c), crc32c::Crc32c(view));
- }
-
--#endif // !defined(_MSC_VER) || __cplusplus >= 201703L
- #endif // __has_include(<string_view>)
--#endif // defined(__has_include)
-+#endif // __cplusplus > 201402L
-
- #define TESTED_EXTEND Extend
- #include "./crc32c_extend_unittests.h"