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

Unified Diff: src/base/macros.h

Issue 668303002: only define ARRAYSIZE_UNSAFE for NaCl builds (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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
« 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: src/base/macros.h
diff --git a/src/base/macros.h b/src/base/macros.h
index 79cf04ccf2b2637a0c70234ac49849b27e22f20b..752061258adf396f43c511d0c3838c947c3c68be 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -25,6 +25,8 @@
(reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4)
+#if V8_OS_NACL
+
// ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,
// but can be used on anonymous types or types defined inside
// functions. It's less safe than arraysize as it accepts some
@@ -65,9 +67,6 @@
((sizeof(a) / sizeof(*(a))) / \
static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) // NOLINT
-
-#if V8_OS_NACL
-
// TODO(bmeurer): For some reason, the NaCl toolchain cannot handle the correct
// definition of arraysize() below, so we have to use the unsafe version for
// now.
« 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