Commit 283982cb authored by bfulgham@apple.com's avatar bfulgham@apple.com

../JavaScriptCore: [Win] Support compiling with VS2013

https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* API/tests/testapi.c: Use C99 defines if available.
* jit/JITOperations.cpp: Don't attempt to define C linkage when
returning a C++ object.

../WebCore: [Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Use nullptr
(WebCore::LegacyWebArchive::createFromSelection): Ditto

../WebKit: [Win] Support compiling with VS2013.
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Provide
proper exports for VS2013 build.

../WTF: [Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* wtf/Compiler.h: Show proper features for VS2012 and VS2013.
* wtf/MathExtras.h: Don't implement common C99 routines when
they are available through the runtime libraries.
* wtf/RetainPtr.h:
(WTF::RetainPtr::operator bool): Added.
* wtf/StdLibExtras.h: Use Microsoft's version of make_unique
when it exists.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 66421ea3
......@@ -45,6 +45,7 @@
#if COMPILER(MSVC)
#if _MSC_VER < 1800
#include <wtf/MathExtras.h>
static double nan(const char*)
......@@ -54,6 +55,7 @@ static double nan(const char*)
using std::isinf;
using std::isnan;
#endif
#endif
......
2013-12-06 Roger Fong <roger_fong@apple.com> and Brent Fulgham <bfulgham@apple.com>
[Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353
Reviewed by Anders Carlsson.
* API/tests/testapi.c: Use C99 defines if available.
* jit/JITOperations.cpp: Don't attempt to define C linkage when
returning a C++ object.
2013-12-06 Filip Pizlo <fpizlo@apple.com>
FTL should support generic ByVal accesses
......
......@@ -1363,6 +1363,8 @@ EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_
return JSValue::encode(baseValue.get(exec, ident, slot));
}
}
static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress)
{
if (LIKELY(baseValue.isCell() && subscript.isString())) {
......@@ -1386,6 +1388,8 @@ static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, R
return baseValue.get(exec, property);
}
extern "C" {
EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript)
{
VM& vm = exec->vm();
......
2013-12-06 Roger Fong <roger_fong@apple.com> and Brent Fulgham <bfulgham@apple.com>
[Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353
Reviewed by Anders Carlsson.
* wtf/Compiler.h: Show proper features for VS2012 and VS2013.
* wtf/MathExtras.h: Don't implement common C99 routines when
they are available through the runtime libraries.
* wtf/RetainPtr.h:
(WTF::RetainPtr::operator bool): Added.
* wtf/StdLibExtras.h: Use Microsoft's version of make_unique
when it exists.
2013-12-06 Laszlo Vidacs <lac@inf.u-szeged.hu>
Define SHA1 hash size in SHA1.h and use it at various places.
......
......@@ -79,8 +79,10 @@
#if !COMPILER(CLANG)
#define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1
#if !defined(_MSC_VER) || _MSC_VER < 1800
#define WTF_COMPILER_QUIRK_FINAL_IS_CALLED_SEALED 1
#endif
#endif
/* Check for VS2010 or newer */
#if _MSC_VER >= 1600
......@@ -89,6 +91,18 @@
#define WTF_COMPILER_SUPPORTS_CXX_AUTO_TYPE 1
#endif
#if _MSC_VER >= 1700
#define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1
#define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1
#endif
#if _MSC_VER >= 1800
#define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1
#define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1
#define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS 1
#define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES 1
#endif
#endif /* defined(_MSC_VER) */
/* COMPILER(RVCT) - ARM RealView Compilation Tools */
......
......@@ -123,6 +123,7 @@ inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x
#if COMPILER(MSVC)
#if _MSC_VER < 1800
// We must not do 'num + 0.5' or 'num - 0.5' because they can cause precision loss.
static double round(double num)
{
......@@ -138,14 +139,13 @@ static float roundf(float num)
return integer - num > 0.5f ? integer - 1.0f : integer;
return integer - num >= 0.5f ? integer - 1.0f : integer;
}
inline long long llround(double num) { return static_cast<long long>(round(num)); }
inline long long llroundf(float num) { return static_cast<long long>(roundf(num)); }
inline long lround(double num) { return static_cast<long>(round(num)); }
inline long lroundf(float num) { return static_cast<long>(roundf(num)); }
inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); }
#if _MSC_VER < 1800
inline double remainder(double numerator, double denominator)
{
double result = fmod(numerator, denominator);
......@@ -155,8 +155,6 @@ inline double remainder(double numerator, double denominator)
return result;
}
#endif
inline double asinh(double d)
{
return log(d + sqrt(d * d + 1.0));
......@@ -189,6 +187,8 @@ inline double cbrt(double d)
#endif
#endif
#if COMPILER(GCC) && OS(QNX)
// The stdlib on QNX doesn't contain long abs(long). See PR #104666.
inline long long abs(long num) { return labs(num); }
......@@ -215,6 +215,8 @@ inline float log2f(float num)
inline long long abs(long long num) { return _abs64(num); }
#endif
#if _MSC_VER < 1800
namespace std {
inline bool isinf(double num) { return !_finite(num) && !_isnan(num); }
......@@ -224,6 +226,8 @@ inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
} // namespace std
#endif
inline double nextafter(double x, double y) { return _nextafter(x, y); }
inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x + FLT_EPSILON; }
......
......@@ -119,6 +119,7 @@ namespace WTF {
PtrType operator->() const { return fromStorageType(m_ptr); }
#if COMPILER_SUPPORTS(CXX_EXPLICIT_CONVERSIONS)
explicit operator PtrType() const { return fromStorageType(m_ptr); }
explicit operator bool() const { return m_ptr; }
#endif
bool operator!() const { return !m_ptr; }
......
......@@ -335,11 +335,13 @@ namespace std {
};
#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
#if !defined(_MSC_VER) || _MSC_VER < 1800
template<class T, class... Args> inline typename _Unique_if<T>::_Single_object
make_unique(Args&&... args)
{
return unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif
#else
template<class T> inline typename _Unique_if<T>::_Single_object
make_unique()
......@@ -408,12 +410,14 @@ namespace std {
}
#endif
#if !defined(_MSC_VER) || _MSC_VER < 1800
template<class T> inline typename _Unique_if<T>::_Unknown_bound
make_unique(size_t n)
{
typedef typename remove_extent<T>::type U;
return unique_ptr<T>(new U[n]());
}
#endif
#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
template<class T, class... Args> typename _Unique_if<T>::_Known_bound
......
2013-12-06 Roger Fong <roger_fong@apple.com> and Brent Fulgham <bfulgham@apple.com>
[Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353
Reviewed by Anders Carlsson.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Use nullptr
(WebCore::LegacyWebArchive::createFromSelection): Ditto
2013-11-15 Jer Noble <jer.noble@apple.com>
[MSE][Mac] Add a new MSE-compatible MediaPlayerPrivate implementation, MediaPlayerPrivateMediaSourceAVFObjC
......@@ -494,7 +494,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Range* range)
Vector<Node*> nodeList;
String markupString = documentTypeString(document) + createMarkup(*range, &nodeList, AnnotateForInterchange);
return create(markupString, frame, nodeList, 0);
return create(markupString, frame, nodeList, nullptr);
}
PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Frame* frame, const Vector<Node*>& nodes, std::function<bool (Frame&)> frameFilter)
......@@ -601,7 +601,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::createFromSelection(Frame* frame)
builder.append(createMarkup(*selectionRange, &nodeList, AnnotateForInterchange));
String markupString = builder.toString();
RefPtr<LegacyWebArchive> archive = create(markupString, frame, nodeList, 0);
RefPtr<LegacyWebArchive> archive = create(markupString, frame, nodeList, nullptr);
if (!document->isFrameSet())
return archive.release();
......
2013-12-06 Roger Fong <roger_fong@apple.com> and Brent Fulgham <bfulgham@apple.com>
[Win] Support compiling with VS2013.
https://bugs.webkit.org/show_bug.cgi?id=125353
Reviewed by Anders Carlsson.
* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Provide
proper exports for VS2013 build.
2013-12-06 Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu>
Build fix after r160207, remove the BitmapImage::decodeSize symbol export
......
......@@ -346,7 +346,12 @@ EXPORTS
symbolWithPointer(?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@HHHHHHH@Z, ?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PEAVFrame@2@HHHHHHH@Z)
symbolWithPointer(?close@DOMWindow@WebCore@@QAEXPAVScriptExecutionContext@2@@Z, ?close@DOMWindow@WebCore@@QEAAXPEAVScriptExecutionContext@2@@Z)
symbolWithPointer(?document@DOMWindow@WebCore@@QBEPAVDocument@2@XZ, ?document@DOMWindow@WebCore@@QEBAPEAVDocument@2@XZ)
#if _MSC_VER < 1800
symbolWithPointer(?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0PAV12@2@Z, ?open@DOMWindow@WebCore@@QEAA?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@AEBVString@4@AEBVAtomicString@4@0PEAV12@2@Z)
#else
symbolWithPointer(?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0AAV12@2@Z, ?open@DOMWindow@WebCore@@QEAA?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@AEBVString@4@AEBVAtomicString@4@0AEAV12@2@Z)
#endif
symbolWithPointer(?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVDOMWindow@1@@Z, ?toJS@WebCore@@YA?AVJSValue@JSC@@PEAVExecState@3@PEAVJSDOMGlobalObject@1@PEAVDOMWindow@1@@Z)
symbolWithPointer(?layerTreeAsText@Frame@WebCore@@QBE?AVString@WTF@@I@Z, ?layerTreeAsText@Frame@WebCore@@QEBA?AVString@WTF@@I@Z)
symbolWithPointer(?trackedRepaintRectsAsText@Frame@WebCore@@QBE?AVString@WTF@@XZ, ?trackedRepaintRectsAsText@Frame@WebCore@@QEBA?AVString@WTF@@XZ)
......@@ -459,3 +464,8 @@ EXPORTS
symbolWithPointer(?cacheStorage@WebCore@@YAAAVApplicationCacheStorage@1@XZ, ?cacheStorage@WebCore@@YAAEAVApplicationCacheStorage@1@XZ)
symbolWithPointer(?setDefaultOriginQuota@ApplicationCacheStorage@WebCore@@QAEX_J@Z, ?setDefaultOriginQuota@ApplicationCacheStorage@WebCore@@QEAAX_J@Z)
symbolWithPointer(?vm@ScriptExecutionContext@WebCore@@QAEPAVVM@JSC@@XZ, ?vm@ScriptExecutionContext@WebCore@@QEAAPEAVVM@JSC@@XZ)
#if _MSC_VER >= 1800
symbolWithPointer(?completeURL@Document@WebCore@@UBE?AVURL@2@ABVString@WTF@@@Z, ?completeURL@Document@WebCore@@UBE?AVURL@2@ABVString@WTF@@@Z)
symbolWithPointer(??1DOMWindow@WebCore@@UAE@XZ, ??1DOMWindow@WebCore@@UAE@XZ)
symbolWithPointer(?visibleContentRect@ScrollView@WebCore@@UBE?AVIntRect@2@W4VisibleContentRectIncludesScrollbars@ScrollableArea@2@@Z, ?visibleContentRect@ScrollView@WebCore@@UBE?AVIntRect@2@W4VisibleContentRectIncludesScrollbars@ScrollableArea@2@@Z)
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment