From 3b0a429371b729df752f8158fa03db74fb4f5c21 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Thu, 14 Nov 2024 11:06:22 -0500 Subject: [PATCH] Fix #includes - Where std::nullptr_t is used (in namespace std), #include , even if it appears alongside because types like intptr_t are used (in the root namespace). - Where math library functions are used, #include to get and use the versions of functions in namespace std which are overloaded by argument type, such as std::isinf and std::isnan. third_party is excluded. Change-Id: Ic9c143f407e5a9c5cff4098cf566ba5caf4bf6d8 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6021439 Commit-Queue: Mark Mentovai Reviewed-by: Joshua Peraza --- snapshot/linux/signal_context.h | 2 +- util/misc/from_pointer_cast.h | 1 + util/synchronization/semaphore_posix.cc | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/snapshot/linux/signal_context.h b/snapshot/linux/signal_context.h index 89e697a0..a76852e2 100644 --- a/snapshot/linux/signal_context.h +++ b/snapshot/linux/signal_context.h @@ -16,11 +16,11 @@ #define CRASHPAD_SNAPSHOT_LINUX_SNAPSHOT_SIGNAL_CONTEXT_H_ #include +#include #include #include #include -#include #include #include "build/build_config.h" diff --git a/util/misc/from_pointer_cast.h b/util/misc/from_pointer_cast.h index becf08f0..64ed96f7 100644 --- a/util/misc/from_pointer_cast.h +++ b/util/misc/from_pointer_cast.h @@ -15,6 +15,7 @@ #ifndef CRASHPAD_UTIL_MISC_FROM_POINTER_CAST_H_ #define CRASHPAD_UTIL_MISC_FROM_POINTER_CAST_H_ +#include #include #include diff --git a/util/synchronization/semaphore_posix.cc b/util/synchronization/semaphore_posix.cc index 1aa4a649..ea20d3ca 100644 --- a/util/synchronization/semaphore_posix.cc +++ b/util/synchronization/semaphore_posix.cc @@ -15,10 +15,10 @@ #include "util/synchronization/semaphore.h" #include -#include #include #include +#include #include "base/check_op.h" #include "base/logging.h" @@ -43,7 +43,7 @@ void Semaphore::Wait() { bool Semaphore::TimedWait(double seconds) { DCHECK_GE(seconds, 0.0); - if (isinf(seconds)) { + if (std::isinf(seconds)) { Wait(); return true; } @@ -81,7 +81,7 @@ void Semaphore::Wait() { bool Semaphore::TimedWait(double seconds) { DCHECK_GE(seconds, 0.0); - if (isinf(seconds)) { + if (std::isinf(seconds)) { Wait(); return true; }