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

Unified Diff: util/misc/struct_pack.h

Issue 883773005: win: Work towards getting 'minidump' to compile (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@crash-report-db-win
Patch Set: . Created 5 years, 11 months 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
« snapshot/process_snapshot.h ('K') | « snapshot/process_snapshot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/struct_pack.h
diff --git a/util/test/executable_path_win.cc b/util/misc/struct_pack.h
similarity index 54%
copy from util/test/executable_path_win.cc
copy to util/misc/struct_pack.h
index 024478d7552d5a0a3cdb03e5f686d193549b2ee3..55ecbda00efc0b82c19a493e0532a2064fffc753 100644
--- a/util/test/executable_path_win.cc
+++ b/util/misc/struct_pack.h
@@ -12,18 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "util/test/executable_path.h"
+#ifndef CRASHPAD_UTIL_MISC_STRUCT_PACK_H_
+#define CRASHPAD_UTIL_MISC_STRUCT_PACK_H_
-#include <windows.h>
+#include "base/compiler_specific.h"
-namespace crashpad {
-namespace test {
+#if defined(COMPILER_MSVC)
+#define PACK_AND_ALIGN_N(decl, N) \
+ __pragma(pack(push, 1)) __declspec(align(N)) decl __pragma(pack(pop))
+#else
+#define PACK_AND_ALIGN_N(decl, N) decl __attribute__((packed, aligned(N)))
Mark Mentovai 2015/02/02 22:10:28 If you wind up with an #if defined(DOXYGEN) branch
+#endif // COMPILER_MSVC
-base::FilePath ExecutablePath() {
- wchar_t executable_path[_MAX_PATH];
- GetModuleFileName(nullptr, executable_path, sizeof(executable_path));
- return base::FilePath(executable_path);
-}
+#define PACK_AND_ALIGN_4(decl) PACK_AND_ALIGN_N(decl, 4)
+#define PACK_AND_ALIGN_16(decl) PACK_AND_ALIGN_N(decl, 16)
-} // namespace test
-} // namespace crashpad
+#endif // CRASHPAD_UTIL_MISC_STRUCT_PACK_H_
« snapshot/process_snapshot.h ('K') | « snapshot/process_snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698