1
0
mirror of https://github.com/danog/patches.git synced 2024-11-29 20:09:09 +01:00

Force using of std::optional.

This commit is contained in:
John Preston 2020-07-08 18:18:35 +04:00
parent a216704358
commit 49444a529b
2 changed files with 26 additions and 4 deletions

View File

@ -12,7 +12,7 @@ index 5ced4596f..db1b27cb2 100644
(is_linux &&
(!is_chromeos || default_toolchain != "//build/toolchain/cros:target"))
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
index 3d5e4dede..bd6a7ddc4 100644
index 3d5e4dede..17b3bcfd0 100644
--- a/config/compiler/BUILD.gn
+++ b/config/compiler/BUILD.gn
@@ -535,7 +535,7 @@ config("compiler") {
@ -24,7 +24,16 @@ index 3d5e4dede..bd6a7ddc4 100644
}
} else if (!is_win && !is_nacl) {
if (target_os == "android") {
@@ -1379,6 +1379,8 @@ config("default_warnings") {
@@ -554,6 +554,8 @@ config("compiler") {
} else {
cflags_cc += [ "-std=c++14" ]
}
+ } else if (is_win) {
+ cflags_cc += [ "/std:c++17" ]
}
if (is_mac) {
@@ -1379,6 +1381,8 @@ config("default_warnings") {
"/wd4715", # 'function' : not all control paths return a value'
# MSVC does not analyze switch (enum) for completeness.
@ -33,7 +42,7 @@ index 3d5e4dede..bd6a7ddc4 100644
]
cflags_cc += [
@@ -1488,7 +1490,7 @@ config("default_warnings") {
@@ -1488,7 +1492,7 @@ config("default_warnings") {
cflags += [ "-Wno-nonportable-include-path" ]
}
@ -42,7 +51,7 @@ index 3d5e4dede..bd6a7ddc4 100644
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
# recognize.
cflags += [
@@ -1528,6 +1530,24 @@ config("default_warnings") {
@@ -1528,6 +1532,24 @@ config("default_warnings") {
]
}
}

View File

@ -12,6 +12,19 @@ index a62632e2c3f..ea2a9325a9c 100644
}
config("libjpeg_turbo_config") {
diff --git a/abseil-cpp/absl/types/optional.h b/abseil-cpp/absl/types/optional.h
index 61540cfdb26..3249d1b90d3 100644
--- a/abseil-cpp/absl/types/optional.h
+++ b/abseil-cpp/absl/types/optional.h
@@ -54,6 +54,8 @@ ABSL_NAMESPACE_END
#else // ABSL_USES_STD_OPTIONAL
+#error "Build with non-std optional is not supported."
+
#include <cassert>
#include <functional>
#include <initializer_list>
diff --git a/libjpeg.gni b/libjpeg.gni
index 049348b79bd..039385c9739 100644
--- a/libjpeg.gni