| Index: src/base/compiler-specific.h
|
| diff --git a/src/base/compiler-specific.h b/src/base/compiler-specific.h
|
| index 9755fc13ce6c077dcd179dcd0ebb74d1eba59906..ac1eb55fdd7d5feca998611968f4c974af9772ea 100644
|
| --- a/src/base/compiler-specific.h
|
| +++ b/src/base/compiler-specific.h
|
| @@ -51,4 +51,27 @@
|
| #define WARN_UNUSED_RESULT /* NOT SUPPORTED */
|
| #endif
|
|
|
| +
|
| +// The C++ standard requires that static const members have an out-of-class
|
| +// definition (in a single compilation unit), but MSVC chokes on this (when
|
| +// language extensions, which are required, are enabled). (You're only likely to
|
| +// notice the need for a definition if you take the address of the member or,
|
| +// more commonly, pass it to a function that takes it as a reference argument --
|
| +// probably an STL function.) This macro makes MSVC do the right thing. See
|
| +// http://msdn.microsoft.com/en-us/library/34h23df8(v=vs.100).aspx for more
|
| +// information. Use like:
|
| +//
|
| +// In .h file:
|
| +// struct Foo {
|
| +// static const int kBar = 5;
|
| +// };
|
| +//
|
| +// In .cc file:
|
| +// STATIC_CONST_MEMBER_DEFINITION const int Foo::kBar;
|
| +#if V8_HAS_DECLSPEC_SELECTANY
|
| +#define STATIC_CONST_MEMBER_DEFINITION __declspec(selectany)
|
| +#else
|
| +#define STATIC_CONST_MEMBER_DEFINITION
|
| +#endif
|
| +
|
| #endif // V8_BASE_COMPILER_SPECIFIC_H_
|
|
|