mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-01-11 00:35:45 +00:00
Fix MSVC build (including on 2015), drop some workarounds for MSVC older than 2013.
The Windows client gyp files were missing proc_maps_linux.cc for the unittest build. Adding that revealed some build errors due to it unconditionally including <inttypes.h>. Removing the workarounds in breakpad_types.h (and a few other places) made that build, which means that Visual C++ 2013 is now our minimum supported version of MSVC. Additionally I tried building with VC++ 2015 and fixed a few warnings (which were failing the build because we have /WX enabled) to ensure that that builds as well. BUG=https://code.google.com/p/google-breakpad/issues/detail?id=669 R=mark@chromium.org Review URL: https://codereview.chromium.org/1353893002 .
This commit is contained in:
parent
f948d8d623
commit
dbf56c53a0
|
@ -73,7 +73,7 @@ BOOL InitInstance(HINSTANCE, int);
|
||||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
static int kCustomInfoCount = 2;
|
static size_t kCustomInfoCount = 2;
|
||||||
static CustomInfoEntry kCustomInfoEntries[] = {
|
static CustomInfoEntry kCustomInfoEntries[] = {
|
||||||
CustomInfoEntry(L"prod", L"CrashTestApp"),
|
CustomInfoEntry(L"prod", L"CrashTestApp"),
|
||||||
CustomInfoEntry(L"ver", L"1.0"),
|
CustomInfoEntry(L"ver", L"1.0"),
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
'<(DEPTH)/processor/logging.cc',
|
'<(DEPTH)/processor/logging.cc',
|
||||||
'<(DEPTH)/processor/minidump.cc',
|
'<(DEPTH)/processor/minidump.cc',
|
||||||
'<(DEPTH)/processor/pathname_stripper.cc',
|
'<(DEPTH)/processor/pathname_stripper.cc',
|
||||||
|
'<(DEPTH)/processor/proc_maps_linux.cc',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -50,9 +50,8 @@ const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION |
|
||||||
|
|
||||||
const DWORD kPipeMode = PIPE_READMODE_MESSAGE;
|
const DWORD kPipeMode = PIPE_READMODE_MESSAGE;
|
||||||
|
|
||||||
int kCustomInfoCount = 2;
|
#define arraysize(f) (sizeof(f) / sizeof(*f))
|
||||||
|
const google_breakpad::CustomInfoEntry kCustomInfoEntries[] = {
|
||||||
google_breakpad::CustomInfoEntry kCustomInfoEntries[] = {
|
|
||||||
google_breakpad::CustomInfoEntry(L"prod", L"CrashGenerationServerTest"),
|
google_breakpad::CustomInfoEntry(L"prod", L"CrashGenerationServerTest"),
|
||||||
google_breakpad::CustomInfoEntry(L"ver", L"1.0"),
|
google_breakpad::CustomInfoEntry(L"ver", L"1.0"),
|
||||||
};
|
};
|
||||||
|
@ -165,7 +164,7 @@ class CrashGenerationServerTest : public ::testing::Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
google_breakpad::CustomClientInfo custom_info = {kCustomInfoEntries,
|
google_breakpad::CustomClientInfo custom_info = {kCustomInfoEntries,
|
||||||
kCustomInfoCount};
|
arraysize(kCustomInfoEntries)};
|
||||||
|
|
||||||
google_breakpad::ProtocolMessage msg(
|
google_breakpad::ProtocolMessage msg(
|
||||||
fault_type == SEND_INVALID_REGISTRATION ?
|
fault_type == SEND_INVALID_REGISTRATION ?
|
||||||
|
|
|
@ -40,35 +40,11 @@
|
||||||
#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
|
#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
|
||||||
#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
|
#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
|
|
||||||
#ifndef __STDC_FORMAT_MACROS
|
#ifndef __STDC_FORMAT_MACROS
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#endif /* __STDC_FORMAT_MACROS */
|
#endif /* __STDC_FORMAT_MACROS */
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#else /* !_WIN32 */
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1600
|
|
||||||
#include <stdint.h>
|
|
||||||
#elif defined(BREAKPAD_CUSTOM_STDINT_H)
|
|
||||||
/* Visual C++ Pre-2010 did not ship a stdint.h, so allow
|
|
||||||
* consumers of this library to provide their own because
|
|
||||||
* there are often subtle type incompatibilities.
|
|
||||||
*/
|
|
||||||
#include BREAKPAD_CUSTOM_STDINT_H
|
|
||||||
#else
|
|
||||||
#include <wtypes.h>
|
|
||||||
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef __int32 int32_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !_WIN32 */
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t high;
|
uint64_t high;
|
||||||
uint64_t low;
|
uint64_t low;
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#define PRIx64 "llx"
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
#define PRIx32 "lx"
|
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
#endif
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
|
@ -44,9 +44,9 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#define PRIx64 "llx"
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
#define PRIx32 "lx"
|
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
#endif
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
|
@ -34,16 +34,16 @@ bool ParseProcMaps(const std::string& input,
|
||||||
|
|
||||||
// Split the string by newlines.
|
// Split the string by newlines.
|
||||||
std::vector<std::string> lines;
|
std::vector<std::string> lines;
|
||||||
std::string line = "";
|
std::string l = "";
|
||||||
for (size_t i = 0; i < input.size(); i++) {
|
for (size_t i = 0; i < input.size(); i++) {
|
||||||
if (input[i] != '\n' && input[i] != '\r') {
|
if (input[i] != '\n' && input[i] != '\r') {
|
||||||
line.push_back(input[i]);
|
l.push_back(input[i]);
|
||||||
} else if (line.size() > 0) {
|
} else if (l.size() > 0) {
|
||||||
lines.push_back(line);
|
lines.push_back(l);
|
||||||
line.clear();
|
l.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (line.size() > 0) {
|
if (l.size() > 0) {
|
||||||
BPLOG(ERROR) << "Input doesn't end in newline";
|
BPLOG(ERROR) << "Input doesn't end in newline";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue