0

Adding "static_assert" in lieu of "COMPILE_ASSERT" in ipc module

All our toolchains support c++'s static_assert now- COMPILE_ASSERT can be removed now.

BUG=442514

Review URL: https://codereview.chromium.org/824243004

Cr-Commit-Position: refs/heads/master@{#312568}
This commit is contained in:
anujk.sharma
2015-01-21 21:39:37 -08:00
committed by Commit bot
parent e01f4987bc
commit 5a7ffe2f6f
3 changed files with 8 additions and 7 deletions

@ -29,8 +29,9 @@ ChannelWin::State::State(ChannelWin* channel) : is_pending(false) {
}
ChannelWin::State::~State() {
COMPILE_ASSERT(!offsetof(ChannelWin::State, context),
starts_with_io_context);
static_assert(offsetof(ChannelWin::State, context) == 0,
"ChannelWin::State should have context as its first data"
"member.");
}
ChannelWin::ChannelWin(const IPC::ChannelHandle &channel_handle,

@ -38,9 +38,9 @@ const unsigned kNumMessages = 20;
const char* kDevZeroPath = "/dev/zero";
#if defined(OS_POSIX)
COMPILE_ASSERT(kNumFDsToSend ==
IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage,
num_fds_to_send_must_be_the_same_as_the_max_desc_per_message);
static_assert(kNumFDsToSend ==
IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage,
"The number of FDs to send must be kMaxDescriptorsPerMessage.");
#endif
class MyChannelDescriptorListenerBase : public IPC::Listener {

@ -20,8 +20,8 @@
namespace IPC {
// Verify that kMaxSocketNameLength is a decent size.
COMPILE_ASSERT(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength,
BAD_SUN_PATH_LENGTH);
static_assert(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxSocketNameLength,
"sun_path is too long.");
namespace {