summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/ByteArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/wtf/ByteArray.h')
-rw-r--r--JavaScriptCore/wtf/ByteArray.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/JavaScriptCore/wtf/ByteArray.h b/JavaScriptCore/wtf/ByteArray.h
index f5f5ded..bdec630 100644
--- a/JavaScriptCore/wtf/ByteArray.h
+++ b/JavaScriptCore/wtf/ByteArray.h
@@ -26,7 +26,9 @@
#ifndef ByteArray_h
#define ByteArray_h
+#include <limits.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/Platform.h>
#include <wtf/RefCounted.h>
namespace WTF {
@@ -86,8 +88,17 @@ namespace WTF {
{
}
size_t m_size;
- unsigned char m_data[sizeof(size_t)];
+// MSVC can't handle correctly unsized array.
+// warning C4200: nonstandard extension used : zero-sized array in struct/union
+// Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
+#if COMPILER(MSVC)
+ unsigned char m_data[INT_MAX];
+#else
+ unsigned char m_data[];
+#endif
};
-}
+} // namespace WTF
+
+using WTF::ByteArray;
#endif