Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: client/crashpad_info.cc

Issue 808623002: win: Get client/crashpad_info.cc to compile (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/crashpad_info.cc
diff --git a/client/crashpad_info.cc b/client/crashpad_info.cc
index 507c5005e0855d53fbfdac4189928c98dd0ce98c..6d2c989b81a6cf4850eed70e5738046152ace663 100644
--- a/client/crashpad_info.cc
+++ b/client/crashpad_info.cc
@@ -14,10 +14,13 @@
#include "client/crashpad_info.h"
-#include <mach-o/loader.h>
-
+#include "build/build_config.h"
#include "util/stdlib/cxx.h"
+#if defined(OS_MACOSX)
+#include <mach-o/loader.h>
+#endif
+
#if CXX_LIBRARY_VERSION >= 2011
#include <type_traits>
#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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698