diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ios/Breakpad.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | src/client/mac/handler/minidump_generator.cc | 21 | ||||
-rw-r--r-- | src/client/minidump_file_writer.cc | 8 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/client/ios/Breakpad.xcodeproj/project.pbxproj b/src/client/ios/Breakpad.xcodeproj/project.pbxproj index 91e1b812..e9fcae3f 100644 --- a/src/client/ios/Breakpad.xcodeproj/project.pbxproj +++ b/src/client/ios/Breakpad.xcodeproj/project.pbxproj @@ -498,6 +498,7 @@ 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; @@ -519,12 +520,14 @@ ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + WARNING_CFLAGS = "-Wundef"; }; name = Debug; }; 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -544,6 +547,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.0; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + WARNING_CFLAGS = "-Wundef"; }; name = Release; }; diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index 2326973a..7b166e58 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -62,7 +62,7 @@ using MacStringUtils::IntegerValueAtIndex; namespace google_breakpad { -#if __LP64__ +#if defined(__LP64__) && __LP64__ #define LC_SEGMENT_ARCH LC_SEGMENT_64 #else #define LC_SEGMENT_ARCH LC_SEGMENT @@ -627,8 +627,11 @@ bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state, MDRawContextPPC *context_ptr = context.get(); context_ptr->context_flags = MD_CONTEXT_PPC_BASE; -#define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a) -#define AddGPR(a) context_ptr->gpr[a] = REGISTER_FROM_THREADSTATE(machine_state, r ## a) +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) +#define AddGPR(a) context_ptr->gpr[a] = \ + static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, r ## a) AddReg(srr0); AddReg(cr); @@ -690,8 +693,11 @@ bool MinidumpGenerator::WriteContextPPC64( MDRawContextPPC64 *context_ptr = context.get(); context_ptr->context_flags = MD_CONTEXT_PPC_BASE; -#define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a) -#define AddGPR(a) context_ptr->gpr[a] = REGISTER_FROM_THREADSTATE(machine_state, r ## a) +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) +#define AddGPR(a) context_ptr->gpr[a] = \ + static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, r ## a) AddReg(srr0); AddReg(cr); @@ -789,7 +795,8 @@ bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state, *register_location = context.location(); MDRawContextX86 *context_ptr = context.get(); -#define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a) +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) context_ptr->context_flags = MD_CONTEXT_X86; AddReg(eax); @@ -828,7 +835,7 @@ bool MinidumpGenerator::WriteContextX86_64( *register_location = context.location(); MDRawContextAMD64 *context_ptr = context.get(); -#define AddReg(a) context_ptr->a = static_cast<typeof(context_ptr->a)>( \ +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ REGISTER_FROM_THREADSTATE(machine_state, a)) context_ptr->context_flags = MD_CONTEXT_AMD64; diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc index 1e18d24b..9e905335 100644 --- a/src/client/minidump_file_writer.cc +++ b/src/client/minidump_file_writer.cc @@ -40,7 +40,7 @@ #include "client/minidump_file_writer-inl.h" #include "common/linux/linux_libc_support.h" #include "common/string_conversion.h" -#if __linux__ +#if defined(__linux__) && __linux__ #include "third_party/lss/linux_syscall_support.h" #endif @@ -62,7 +62,7 @@ MinidumpFileWriter::~MinidumpFileWriter() { bool MinidumpFileWriter::Open(const char *path) { assert(file_ == -1); -#if __linux__ +#if defined(__linux__) && __linux__ file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); #else file_ = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); @@ -84,7 +84,7 @@ bool MinidumpFileWriter::Close() { if (-1 == ftruncate(file_, position_)) { return false; } -#if __linux__ +#if defined(__linux__) && __linux__ result = (sys_close(file_) == 0); #else result = (close(file_) == 0); @@ -253,7 +253,7 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) { return false; // Seek and write the data -#if __linux__ +#if defined(__linux__) && __linux__ if (sys_lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) { if (sys_write(file_, src, size) == size) { #else |