Revision: 24875
Author:   [email protected]
Date:     Fri Oct 24 13:21:17 2014 UTC
Log:      only define ARRAYSIZE_UNSAFE for NaCl builds

Now that C++11 is allowed, we can use arraysize instead of
ARRAYSIZE_UNSAFE, except in NaCl builds.  So let's move this
macro inside an NaCl ifdef.

BUG=chromium:405225
LOG=y
[email protected]

Review URL: https://codereview.chromium.org/668303002

Patch from Mostyn Bramley-Moore <[email protected]>.
https://code.google.com/p/v8/source/detail?r=24875

Modified:
 /branches/bleeding_edge/src/base/macros.h

=======================================
--- /branches/bleeding_edge/src/base/macros.h   Fri Oct 24 12:33:58 2014 UTC
+++ /branches/bleeding_edge/src/base/macros.h   Fri Oct 24 13:21:17 2014 UTC
@@ -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.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to