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

Side by Side Diff: src/base/macros.h

Issue 304153016: Use full include paths everywhere (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/base/build_config.h ('k') | src/bignum.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_BASE_MACROS_H_ 5 #ifndef V8_BASE_MACROS_H_
6 #define V8_BASE_MACROS_H_ 6 #define V8_BASE_MACROS_H_
7 7
8 #include "../../include/v8stdint.h" 8 #include "include/v8stdint.h"
9 9
10 10
11 // The expression OFFSET_OF(type, field) computes the byte-offset 11 // The expression OFFSET_OF(type, field) computes the byte-offset
12 // of the specified field relative to the containing type. This 12 // of the specified field relative to the containing type. This
13 // corresponds to 'offsetof' (in stddef.h), except that it doesn't 13 // corresponds to 'offsetof' (in stddef.h), except that it doesn't
14 // use 0 or NULL, which causes a problem with the compiler warnings 14 // use 0 or NULL, which causes a problem with the compiler warnings
15 // we have enabled (which is also why 'offsetof' doesn't seem to work). 15 // we have enabled (which is also why 'offsetof' doesn't seem to work).
16 // Here we simply use the non-zero value 4, which seems to work. 16 // Here we simply use the non-zero value 4, which seems to work.
17 #define OFFSET_OF(type, field) \ 17 #define OFFSET_OF(type, field) \
18 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) 18 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 #endif 104 #endif
105 105
106 106
107 // The USE(x) template is used to silence C++ compiler warnings 107 // The USE(x) template is used to silence C++ compiler warnings
108 // issued for (yet) unused variables (typically parameters). 108 // issued for (yet) unused variables (typically parameters).
109 template <typename T> 109 template <typename T>
110 inline void USE(T) { } 110 inline void USE(T) { }
111 111
112 #endif // V8_BASE_MACROS_H_ 112 #endif // V8_BASE_MACROS_H_
OLDNEW
« no previous file with comments | « src/base/build_config.h ('k') | src/bignum.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698