From 48b9a40539689743bacbe20df01182b0c367c2c0 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Tue, 24 Mar 2015 11:25:14 +0000 Subject: Fix compilation with gcc --std=c++11 Patch by Jon Turney R=ted at https://breakpad.appspot.com/7824002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1435 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/dump_writer_common/seccomp_unwinder.cc | 12 ++++++------ src/client/linux/dump_writer_common/thread_info.h | 2 +- src/client/linux/handler/exception_handler_unittest.cc | 2 +- src/client/linux/minidump_writer/linux_dumper.h | 2 +- .../tests/crash_generation_app/crash_generation_app.cc | 14 +++++++------- 5 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/client') diff --git a/src/client/linux/dump_writer_common/seccomp_unwinder.cc b/src/client/linux/dump_writer_common/seccomp_unwinder.cc index 241bf1b0..e9d1ec78 100644 --- a/src/client/linux/dump_writer_common/seccomp_unwinder.cc +++ b/src/client/linux/dump_writer_common/seccomp_unwinder.cc @@ -74,14 +74,14 @@ void SeccompUnwinder::PopSeccompStackFrame(RawContextCPU* cpu, uint64_t ret; /* char redzone[128]; */ } seccomp_stackframe; - if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top || - top - offsetof(typeof(seccomp_stackframe), deadbeef) + + if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top || + top - offsetof(__typeof__(seccomp_stackframe), deadbeef) + sizeof(seccomp_stackframe) > thread.stack.start_of_memory_range+thread.stack.memory.data_size) { break; } my_memcpy(&seccomp_stackframe, - bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef), + bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef), sizeof(seccomp_stackframe)); cpu->rbx = seccomp_stackframe.rbx; cpu->rcx = seccomp_stackframe.rcx; @@ -128,14 +128,14 @@ void SeccompUnwinder::PopSeccompStackFrame(RawContextCPU* cpu, uint32_t fakeret; uint32_t ret; } seccomp_stackframe; - if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top || - top - offsetof(typeof(seccomp_stackframe), deadbeef) + + if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top || + top - offsetof(__typeof__(seccomp_stackframe), deadbeef) + sizeof(seccomp_stackframe) > thread.stack.start_of_memory_range+thread.stack.memory.data_size) { break; } my_memcpy(&seccomp_stackframe, - bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef), + bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef), sizeof(seccomp_stackframe)); cpu->ebx = seccomp_stackframe.ebx; cpu->ecx = seccomp_stackframe.ecx; diff --git a/src/client/linux/dump_writer_common/thread_info.h b/src/client/linux/dump_writer_common/thread_info.h index 5f24fd6b..cf6d0101 100644 --- a/src/client/linux/dump_writer_common/thread_info.h +++ b/src/client/linux/dump_writer_common/thread_info.h @@ -40,7 +40,7 @@ namespace google_breakpad { #if defined(__i386) || defined(__x86_64) -typedef typeof(((struct user*) 0)->u_debugreg[0]) debugreg_t; +typedef __typeof__(((struct user*) 0)->u_debugreg[0]) debugreg_t; #endif // We produce one of these structures for each thread in the crashed process. diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index fc81f61f..6deea55b 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -955,7 +955,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) { const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0)); ASSERT_EQ(static_cast(kCrashContextSize), n); ASSERT_EQ(kControlMsgSize, msg.msg_controllen); - ASSERT_EQ(static_cast(0), msg.msg_flags); + ASSERT_EQ(static_cast<__typeof__(msg.msg_flags)>(0), msg.msg_flags); ASSERT_EQ(0, close(fds[0])); pid_t crashing_pid = -1; diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h index d4310d7e..2fc88486 100644 --- a/src/client/linux/minidump_writer/linux_dumper.h +++ b/src/client/linux/minidump_writer/linux_dumper.h @@ -58,7 +58,7 @@ typedef Elf32_auxv_t elf_aux_entry; typedef Elf64_auxv_t elf_aux_entry; #endif -typedef typeof(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t; +typedef __typeof__(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t; // When we find the VDSO mapping in the process's address space, this // is the name we use for it when writing it to the minidump. diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc index fa4e634c..ad395d6c 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc @@ -197,8 +197,8 @@ bool ShowDumpResults(const wchar_t* dump_path, return succeeded; } -static void _cdecl ShowClientConnected(void* context, - const ClientInfo* client_info) { +static void ShowClientConnected(void* context, + const ClientInfo* client_info) { TCHAR* line = new TCHAR[kMaximumLineLength]; line[0] = _T('\0'); int result = swprintf_s(line, @@ -214,9 +214,9 @@ static void _cdecl ShowClientConnected(void* context, QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT); } -static void _cdecl ShowClientCrashed(void* context, - const ClientInfo* client_info, - const wstring* dump_path) { +static void ShowClientCrashed(void* context, + const ClientInfo* client_info, + const wstring* dump_path) { TCHAR* line = new TCHAR[kMaximumLineLength]; line[0] = _T('\0'); int result = swprintf_s(line, @@ -259,8 +259,8 @@ static void _cdecl ShowClientCrashed(void* context, QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT); } -static void _cdecl ShowClientExited(void* context, - const ClientInfo* client_info) { +static void ShowClientExited(void* context, + const ClientInfo* client_info) { TCHAR* line = new TCHAR[kMaximumLineLength]; line[0] = _T('\0'); int result = swprintf_s(line, -- cgit v1.2.1