Bug 555727: Stop MSVC from over-optimizing NS_DECLARE_FRAME_PROPERTY. r=dbaron

This commit is contained in:
Bill Gianopoulos 2010-04-03 16:21:53 -04:00
Родитель 8015c79acc
Коммит 3387c15d67
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -824,11 +824,21 @@ public:
delete static_cast<nsPoint*>(aPropertyValue); delete static_cast<nsPoint*>(aPropertyValue);
} }
#ifdef _MSC_VER
// XXX Workaround MSVC issue by making the static FramePropertyDescriptor
// non-const. See bug 555727.
#define NS_DECLARE_FRAME_PROPERTY(prop, dtor) \
static const FramePropertyDescriptor* prop() { \
static FramePropertyDescriptor descriptor = { dtor }; \
return &descriptor; \
}
#else
#define NS_DECLARE_FRAME_PROPERTY(prop, dtor) \ #define NS_DECLARE_FRAME_PROPERTY(prop, dtor) \
static const FramePropertyDescriptor* prop() { \ static const FramePropertyDescriptor* prop() { \
static const FramePropertyDescriptor descriptor = { dtor }; \ static const FramePropertyDescriptor descriptor = { dtor }; \
return &descriptor; \ return &descriptor; \
} }
#endif
NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialSibling, nsnull) NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialSibling, nsnull)
NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialPrevSibling, nsnull) NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialPrevSibling, nsnull)