From 09d1df04bfa750f91d8b325454eadcb015b9e39d Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Sat, 27 Jun 2020 00:42:33 -0400 Subject: [PATCH] Use OS_WIN, not OS_WINDOWS; provide crashpad_types traits for Fuchsia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The incorrect macro was used in f4b906c79c02 (at my request when I was reviewing from a phone). The Windows and Fuchsia builds are broken, so… TBR: epastor@google.com Change-Id: I8aebbbc24db261f3c3377210bb1c477132964828 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2270920 Commit-Queue: Mark Mentovai Reviewed-by: Mark Mentovai --- .../crashpad_types/crashpad_info_reader.cc | 4 ++- util/BUILD.gn | 1 + util/fuchsia/traits.h | 32 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 util/fuchsia/traits.h diff --git a/snapshot/crashpad_types/crashpad_info_reader.cc b/snapshot/crashpad_types/crashpad_info_reader.cc index e4c8b934..9d0c781f 100644 --- a/snapshot/crashpad_types/crashpad_info_reader.cc +++ b/snapshot/crashpad_types/crashpad_info_reader.cc @@ -20,10 +20,12 @@ #include "client/crashpad_info.h" #include "util/misc/as_underlying_type.h" -#if defined(OS_WINDOWS) +#if defined(OS_WIN) #include "util/win/traits.h" #elif defined(OS_LINUX) || defined(OS_ANDROID) #include "util/linux/traits.h" +#elif defined(OS_FUCHSIA) +#include "util/fuchsia/traits.h" #endif namespace crashpad { diff --git a/util/BUILD.gn b/util/BUILD.gn index 388bc145..bfd75361 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -544,6 +544,7 @@ static_library("util") { "fuchsia/koid_utilities.h", "fuchsia/scoped_task_suspend.cc", "fuchsia/scoped_task_suspend.h", + "fuchsia/traits.h", "misc/capture_context_fuchsia.S", "misc/paths_fuchsia.cc", "process/process_memory_fuchsia.cc", diff --git a/util/fuchsia/traits.h b/util/fuchsia/traits.h new file mode 100644 index 00000000..5cdedc16 --- /dev/null +++ b/util/fuchsia/traits.h @@ -0,0 +1,32 @@ +// Copyright 2020 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef CRASHPAD_UTIL_FUCHSIA_TRAITS_H_ +#define CRASHPAD_UTIL_FUCHSIA_TRAITS_H_ + +#include + +namespace crashpad { + +struct Traits32 { + using Address = uint32_t; +}; + +struct Traits64 { + using Address = uint64_t; +}; + +} // namespace crashpad + +#endif // CRASHPAD_UTIL_FUCHSIA_TRAITS_H_