Fix compilation with gcc --std=c++11
Patch by Jon Turney <jon.turney.1111@gmail.com> R=ted at https://breakpad.appspot.com/7824002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1435 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
9b2d7192a4
commit
48b9a40539
@ -74,14 +74,14 @@ void SeccompUnwinder::PopSeccompStackFrame(RawContextCPU* cpu,
|
|||||||
uint64_t ret;
|
uint64_t ret;
|
||||||
/* char redzone[128]; */
|
/* char redzone[128]; */
|
||||||
} seccomp_stackframe;
|
} seccomp_stackframe;
|
||||||
if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top ||
|
if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top ||
|
||||||
top - offsetof(typeof(seccomp_stackframe), deadbeef) +
|
top - offsetof(__typeof__(seccomp_stackframe), deadbeef) +
|
||||||
sizeof(seccomp_stackframe) >
|
sizeof(seccomp_stackframe) >
|
||||||
thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
|
thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
my_memcpy(&seccomp_stackframe,
|
my_memcpy(&seccomp_stackframe,
|
||||||
bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef),
|
bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef),
|
||||||
sizeof(seccomp_stackframe));
|
sizeof(seccomp_stackframe));
|
||||||
cpu->rbx = seccomp_stackframe.rbx;
|
cpu->rbx = seccomp_stackframe.rbx;
|
||||||
cpu->rcx = seccomp_stackframe.rcx;
|
cpu->rcx = seccomp_stackframe.rcx;
|
||||||
@ -128,14 +128,14 @@ void SeccompUnwinder::PopSeccompStackFrame(RawContextCPU* cpu,
|
|||||||
uint32_t fakeret;
|
uint32_t fakeret;
|
||||||
uint32_t ret;
|
uint32_t ret;
|
||||||
} seccomp_stackframe;
|
} seccomp_stackframe;
|
||||||
if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top ||
|
if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top ||
|
||||||
top - offsetof(typeof(seccomp_stackframe), deadbeef) +
|
top - offsetof(__typeof__(seccomp_stackframe), deadbeef) +
|
||||||
sizeof(seccomp_stackframe) >
|
sizeof(seccomp_stackframe) >
|
||||||
thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
|
thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
my_memcpy(&seccomp_stackframe,
|
my_memcpy(&seccomp_stackframe,
|
||||||
bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef),
|
bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef),
|
||||||
sizeof(seccomp_stackframe));
|
sizeof(seccomp_stackframe));
|
||||||
cpu->ebx = seccomp_stackframe.ebx;
|
cpu->ebx = seccomp_stackframe.ebx;
|
||||||
cpu->ecx = seccomp_stackframe.ecx;
|
cpu->ecx = seccomp_stackframe.ecx;
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
|
|
||||||
#if defined(__i386) || defined(__x86_64)
|
#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
|
#endif
|
||||||
|
|
||||||
// We produce one of these structures for each thread in the crashed process.
|
// We produce one of these structures for each thread in the crashed process.
|
||||||
|
@ -955,7 +955,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) {
|
|||||||
const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0));
|
const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0));
|
||||||
ASSERT_EQ(static_cast<ssize_t>(kCrashContextSize), n);
|
ASSERT_EQ(static_cast<ssize_t>(kCrashContextSize), n);
|
||||||
ASSERT_EQ(kControlMsgSize, msg.msg_controllen);
|
ASSERT_EQ(kControlMsgSize, msg.msg_controllen);
|
||||||
ASSERT_EQ(static_cast<typeof(msg.msg_flags)>(0), msg.msg_flags);
|
ASSERT_EQ(static_cast<__typeof__(msg.msg_flags)>(0), msg.msg_flags);
|
||||||
ASSERT_EQ(0, close(fds[0]));
|
ASSERT_EQ(0, close(fds[0]));
|
||||||
|
|
||||||
pid_t crashing_pid = -1;
|
pid_t crashing_pid = -1;
|
||||||
|
@ -58,7 +58,7 @@ typedef Elf32_auxv_t elf_aux_entry;
|
|||||||
typedef Elf64_auxv_t elf_aux_entry;
|
typedef Elf64_auxv_t elf_aux_entry;
|
||||||
#endif
|
#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
|
// 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.
|
// is the name we use for it when writing it to the minidump.
|
||||||
|
@ -197,8 +197,8 @@ bool ShowDumpResults(const wchar_t* dump_path,
|
|||||||
return succeeded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _cdecl ShowClientConnected(void* context,
|
static void ShowClientConnected(void* context,
|
||||||
const ClientInfo* client_info) {
|
const ClientInfo* client_info) {
|
||||||
TCHAR* line = new TCHAR[kMaximumLineLength];
|
TCHAR* line = new TCHAR[kMaximumLineLength];
|
||||||
line[0] = _T('\0');
|
line[0] = _T('\0');
|
||||||
int result = swprintf_s(line,
|
int result = swprintf_s(line,
|
||||||
@ -214,9 +214,9 @@ static void _cdecl ShowClientConnected(void* context,
|
|||||||
QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
|
QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _cdecl ShowClientCrashed(void* context,
|
static void ShowClientCrashed(void* context,
|
||||||
const ClientInfo* client_info,
|
const ClientInfo* client_info,
|
||||||
const wstring* dump_path) {
|
const wstring* dump_path) {
|
||||||
TCHAR* line = new TCHAR[kMaximumLineLength];
|
TCHAR* line = new TCHAR[kMaximumLineLength];
|
||||||
line[0] = _T('\0');
|
line[0] = _T('\0');
|
||||||
int result = swprintf_s(line,
|
int result = swprintf_s(line,
|
||||||
@ -259,8 +259,8 @@ static void _cdecl ShowClientCrashed(void* context,
|
|||||||
QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
|
QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _cdecl ShowClientExited(void* context,
|
static void ShowClientExited(void* context,
|
||||||
const ClientInfo* client_info) {
|
const ClientInfo* client_info) {
|
||||||
TCHAR* line = new TCHAR[kMaximumLineLength];
|
TCHAR* line = new TCHAR[kMaximumLineLength];
|
||||||
line[0] = _T('\0');
|
line[0] = _T('\0');
|
||||||
int result = swprintf_s(line,
|
int result = swprintf_s(line,
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#define HANDLE_EINTR(x) ({ \
|
#define HANDLE_EINTR(x) ({ \
|
||||||
typeof(x) eintr_wrapper_result; \
|
__typeof__(x) eintr_wrapper_result; \
|
||||||
do { \
|
do { \
|
||||||
eintr_wrapper_result = (x); \
|
eintr_wrapper_result = (x); \
|
||||||
} while (eintr_wrapper_result == -1 && errno == EINTR); \
|
} while (eintr_wrapper_result == -1 && errno == EINTR); \
|
||||||
@ -45,7 +45,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
#define IGNORE_EINTR(x) ({ \
|
#define IGNORE_EINTR(x) ({ \
|
||||||
typeof(x) eintr_wrapper_result; \
|
__typeof__(x) eintr_wrapper_result; \
|
||||||
do { \
|
do { \
|
||||||
eintr_wrapper_result = (x); \
|
eintr_wrapper_result = (x); \
|
||||||
if (eintr_wrapper_result == -1 && errno == EINTR) { \
|
if (eintr_wrapper_result == -1 && errno == EINTR) { \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user