From b0cf01978d0d64bee4bcb4c1a97444cd3410713b Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Tue, 16 Dec 2014 10:22:41 -0800 Subject: [PATCH] win: Get client/crashpad_info.cc to compile Just avoid the Mac-specific __attribute__ tagging for now. There will need to be some Windows-specific pragmas added here once the reader has been written. R=mark@chromium.org BUG=crashpad:1 Review URL: https://codereview.chromium.org/808623002 --- client/crashpad_info.cc | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/client/crashpad_info.cc b/client/crashpad_info.cc index 507c5005..6d2c989b 100644 --- a/client/crashpad_info.cc +++ b/client/crashpad_info.cc @@ -14,10 +14,13 @@ #include "client/crashpad_info.h" -#include - +#include "build/build_config.h" #include "util/stdlib/cxx.h" +#if defined(OS_MACOSX) +#include +#endif + #if CXX_LIBRARY_VERSION >= 2011 #include #endif @@ -45,21 +48,34 @@ union Compile_Assert { }; #endif -// Put the structure in __DATA,__crashpad_info where it can be easily found -// without having to consult the symbol table. The “used” attribute prevents it -// from being dead-stripped. This isn’t placed in an unnamed namespace: -// hopefully, this will catch attempts to place multiple copies of this -// structure into the same module. If that’s attempted, and the name of the -// symbol is the same in each translation unit, it will result in a linker -// error, which is better than having multiple structures show up. +// This structure needs to be stored somewhere that is easy to find without +// external information. +// +// It isn’t placed in an unnamed namespace: hopefully, this will catch attempts +// to place multiple copies of this structure into the same module. If that’s +// attempted, and the name of the symbol is the same in each translation unit, +// it will result in a linker error, which is better than having multiple +// structures show up. // // This may result in a static module initializer in debug-mode builds, but // because it’s POD, no code should need to run to initialize this under // release-mode optimization. +#if defined(OS_MACOSX) + +// Put the structure in __DATA,__crashpad_info where it can be easily found +// without having to consult the symbol table. The “used” attribute prevents it +// from being dead-stripped. __attribute__((section(SEG_DATA ",__crashpad_info"), used, visibility("hidden"))) CrashpadInfo g_crashpad_info; +#elif defined(OS_WIN) + +// TODO(scottmg): Tag in a way that makes it easy to locate on Windows. +CrashpadInfo g_crashpad_info; + +#endif + // static CrashpadInfo* CrashpadInfo::GetCrashpadInfo() { return &g_crashpad_info;