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

Unified Diff: third_party/crashpad/crashpad/util/misc/arraysize_unsafe.h

Issue 2555353002: Update Crashpad to 32981a3ee9d7c2769fb27afa038fe2e194cfa329 (Closed)
Patch Set: fix readme Created 4 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
Index: third_party/crashpad/crashpad/util/misc/arraysize_unsafe.h
diff --git a/third_party/crashpad/crashpad/doc/support/crashpad.doxy.h b/third_party/crashpad/crashpad/util/misc/arraysize_unsafe.h
similarity index 52%
copy from third_party/crashpad/crashpad/doc/support/crashpad.doxy.h
copy to third_party/crashpad/crashpad/util/misc/arraysize_unsafe.h
index 5bfefedd2ad79da8188be1671c74dedd2a88cd41..e53c70b8c8a0f73c9175ea83b6355f7cab4eabc1 100644
--- a/third_party/crashpad/crashpad/doc/support/crashpad.doxy.h
+++ b/third_party/crashpad/crashpad/util/misc/arraysize_unsafe.h
@@ -1,4 +1,4 @@
-// Copyright 2014 The Crashpad Authors. All rights reserved.
+// Copyright 2016 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.
@@ -12,13 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#error This file is not intended to be #included.
+#ifndef CRASHPAD_UTIL_MISC_ARRAYSIZE_UNSAFE_H_
+#define CRASHPAD_UTIL_MISC_ARRAYSIZE_UNSAFE_H_
-//! \namespace crashpad
-//! \brief The main namespace.
+//! \file
-//! \namespace crashpad::internal
-//! \brief The internal namespace, not for public use.
+//! \brief Not the safest way of computing an array’s size…
+//!
+//! `#%include "base/macros.h"` and use its `arraysize()` instead. This macro
+//! should only be used in rare situations where `arraysize()` does not
+//! function.
+#define ARRAYSIZE_UNSAFE(array) (sizeof(array) / sizeof(array[0]))
-//! \namespace crashpad::test
-//! \brief The testing namespace, for use in test code only.
+#endif // CRASHPAD_UTIL_MISC_ARRAYSIZE_UNSAFE_H_

Powered by Google App Engine
This is Rietveld 408576698