Use std=c++11 instead of std=gnu++11 everywhere except nacl
The pnacl_newlib x86 build still has some errors with std=gnu++11
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1522653002 .
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index dad870c..bf2cdb3 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -449,7 +449,7 @@
# C++11 compiler flags setup.
# ---------------------------
- if (is_linux || is_android || is_nacl) {
+ if (is_nacl) {
# gnu++11 instead of c++11 is needed because some code uses typeof() (a
# GNU extension).
# TODO(thakis): Eventually switch this to c++11 instead,
diff --git a/sandbox/linux/services/credentials_unittest.cc b/sandbox/linux/services/credentials_unittest.cc
index 39fd6a7..5d14153 100644
--- a/sandbox/linux/services/credentials_unittest.cc
+++ b/sandbox/linux/services/credentials_unittest.cc
@@ -31,16 +31,6 @@
namespace {
-struct CapFreeDeleter {
- inline void operator()(cap_t cap) const {
- int ret = cap_free(cap);
- CHECK_EQ(0, ret);
- }
-};
-
-// Wrapper to manage libcap2's cap_t type.
-typedef scoped_ptr<typeof(*((cap_t)0)), CapFreeDeleter> ScopedCap;
-
bool WorkingDirectoryIsRoot() {
char current_dir[PATH_MAX];
char* cwd = getcwd(current_dir, sizeof(current_dir));
@@ -224,19 +214,22 @@
caps.push_back(Credentials::Capability::SYS_CHROOT);
CHECK(Credentials::SetCapabilities(proc_fd.get(), caps));
- ScopedCap actual_cap(cap_get_proc());
+ cap_t actual_cap(cap_get_proc());
PCHECK(actual_cap != nullptr);
- ScopedCap expected_cap(cap_init());
+ cap_t expected_cap(cap_init());
PCHECK(expected_cap != nullptr);
const cap_value_t allowed_cap = CAP_SYS_CHROOT;
for (const cap_flag_t flag : {CAP_EFFECTIVE, CAP_PERMITTED}) {
- PCHECK(cap_set_flag(expected_cap.get(), flag, 1, &allowed_cap, CAP_SET) ==
+ PCHECK(cap_set_flag(expected_cap, flag, 1, &allowed_cap, CAP_SET) ==
0);
}
- CHECK_EQ(0, cap_compare(expected_cap.get(), actual_cap.get()));
+ CHECK_EQ(0, cap_compare(expected_cap, actual_cap));
+
+ CHECK_EQ(0, cap_free(expected_cap));
+ CHECK_EQ(0, cap_free(actual_cap));
}
volatile sig_atomic_t signal_handler_called;
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index e4fa164..1ba47be 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -133,10 +133,10 @@
if (is_mac) {
defines += [ "SK_BUILD_FOR_MAC" ]
- }
-
- if (is_ios) {
+ } else if (is_ios) {
defines += [ "SK_BUILD_FOR_IOS" ]
+ } else {
+ defines += [ "SK_BUILD_FOR_UNIX" ]
}
}