Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: sandbox/linux/services/credentials.cc

Issue 821693003: replace COMPILE_ASSERT with static_assert in sandbox/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/services/credentials.cc
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index f926ce8e85dcc117dabf85ece4f8581c728b94f7..c08f4ed1a22a14d5e1708d80e3c620e9bdbc0934 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -59,7 +59,8 @@ struct FILECloser {
// TODO(jln): fix base/.
typedef scoped_ptr<FILE, FILECloser> ScopedFILE;
-COMPILE_ASSERT((base::is_same<uid_t, gid_t>::value), UidAndGidAreSameType);
+static_assert((base::is_same<uid_t, gid_t>::value),
+ "uid_t and gid_t should be the same type");
// generic_id_t can be used for either uid_t or gid_t.
typedef uid_t generic_id_t;
@@ -101,8 +102,8 @@ void ChrootToThreadFdInfo(base::PlatformThreadId tid, bool* result) {
DCHECK(result);
*result = false;
- COMPILE_ASSERT((base::is_same<base::PlatformThreadId, int>::value),
- TidIsAnInt);
+ static_assert((base::is_same<base::PlatformThreadId, int>::value),
+ "platform thread id should be an int");
const std::string current_thread_fdinfo = "/proc/" +
base::IntToString(tid) + "/fdinfo/";
« no previous file with comments | « sandbox/linux/seccomp-bpf/syscall_iterator.cc ('k') | sandbox/linux/syscall_broker/broker_file_permission_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698