diff --git a/engine/bindings/core/v8/ScriptWrappable.cpp b/engine/bindings/core/v8/ScriptWrappable.cpp index 2111f8ad5cd..ca0870943f1 100644 --- a/engine/bindings/core/v8/ScriptWrappable.cpp +++ b/engine/bindings/core/v8/ScriptWrappable.cpp @@ -10,9 +10,6 @@ namespace blink { -#if COMPILER(MSVC) -__declspec(align(4)) -#endif struct SameSizeAsScriptWrappableBase { }; COMPILE_ASSERT(sizeof(ScriptWrappableBase) <= sizeof(SameSizeAsScriptWrappableBase), ScriptWrappableBase_should_stay_small); diff --git a/engine/bindings/core/v8/ScriptWrappable.h b/engine/bindings/core/v8/ScriptWrappable.h index 77445f92147..3f5f3a8a68f 100644 --- a/engine/bindings/core/v8/ScriptWrappable.h +++ b/engine/bindings/core/v8/ScriptWrappable.h @@ -48,26 +48,6 @@ namespace blink { * variable which increase the size of instances. Some of the classes sensitive * to the size inherit from this class. So this class must be zero size. */ -#if COMPILER(MSVC) -// VC++ 2013 doesn't support EBCO (Empty Base Class Optimization). It causes -// that not always pointers to an empty base class are aligned to 4 byte -// alignment. For example, -// -// class EmptyBase1 {}; -// class EmptyBase2 {}; -// class Derived : public EmptyBase1, public EmptyBase2 {}; -// Derived d; -// // &d == 0x1000 -// // static_cast(&d) == 0x1000 -// // static_cast(&d) == 0x1001 // Not 4 byte alignment! -// -// This doesn't happen with other compilers which support EBCO. All the -// addresses in the above example will be 0x1000 with EBCO supported. -// -// Since v8::Object::SetAlignedPointerInInternalField requires the pointers to -// be aligned, we need a hack to specify at least 4 byte alignment to MSVC. -__declspec(align(4)) -#endif class ScriptWrappableBase { public: template diff --git a/engine/config.h b/engine/config.h index 5c137f79785..2a7aeb3f5ec 100644 --- a/engine/config.h +++ b/engine/config.h @@ -24,10 +24,6 @@ /* Include compiler specific macros */ #include "wtf/Compiler.h" -#if COMPILER(MSVC) -#define _USE_MATH_DEFINES // Make math.h behave like other platforms. -#endif - /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ /* HAVE() - specific system features (headers, functions or similar) that are present or not */ diff --git a/engine/core/dom/ElementData.h b/engine/core/dom/ElementData.h index 101c4336387..1113e0604c0 100644 --- a/engine/core/dom/ElementData.h +++ b/engine/core/dom/ElementData.h @@ -104,11 +104,6 @@ private: template inline thisType* to##thisType(const RefPtr& data) { return to##thisType(data.get()); } \ DEFINE_TYPE_CASTS(thisType, ElementData, data, pointerPredicate, referencePredicate) -#if COMPILER(MSVC) -#pragma warning(push) -#pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning -#endif - // SharableElementData is managed by ElementDataCache and is produced by // the parser during page load for elements that have identical attributes. This // is a memory optimization since it's very common for many elements to have @@ -140,10 +135,6 @@ public: DEFINE_ELEMENT_DATA_TYPE_CASTS(ShareableElementData, !data->isUnique(), !data.isUnique()); -#if COMPILER(MSVC) -#pragma warning(pop) -#endif - // UniqueElementData is created when an element needs to mutate its attributes // or gains presentation attribute style (ex. width="10"). It does not need to // be created to fill in values in the ElementData that are derived from diff --git a/engine/core/html/parser/MarkupTokenizerInlines.h b/engine/core/html/parser/MarkupTokenizerInlines.h index 13747c611ff..9b34243738b 100644 --- a/engine/core/html/parser/MarkupTokenizerInlines.h +++ b/engine/core/html/parser/MarkupTokenizerInlines.h @@ -60,12 +60,6 @@ inline void advanceStringAndASSERT(SegmentedString& source, const char* expected source.advanceAndASSERT(*expectedCharacters++); } -#if COMPILER(MSVC) -// We need to disable the "unreachable code" warning because we want to assert -// that some code points aren't reached in the state machine. -#pragma warning(disable: 4702) -#endif - #define BEGIN_STATE(prefix, stateName) case prefix::stateName: stateName: #define END_STATE() ASSERT_NOT_REACHED(); break; diff --git a/engine/platform/Length.h b/engine/platform/Length.h index 5277fb21d43..a9252842986 100644 --- a/engine/platform/Length.h +++ b/engine/platform/Length.h @@ -120,7 +120,6 @@ public: return *this; } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) Length(Length&& length) { memcpy(this, &length, sizeof(Length)); @@ -148,7 +147,6 @@ public: return *this; } -#endif ~Length() { diff --git a/engine/platform/PlatformExport.h b/engine/platform/PlatformExport.h index 8230fbb80fe..e8f6e572e19 100644 --- a/engine/platform/PlatformExport.h +++ b/engine/platform/PlatformExport.h @@ -37,30 +37,9 @@ #endif #if defined(COMPONENT_BUILD) -#if defined(WIN32) -#if BLINK_PLATFORM_IMPLEMENTATION -#define PLATFORM_EXPORT __declspec(dllexport) -#else -#define PLATFORM_EXPORT __declspec(dllimport) -#endif -#else // defined(WIN32) #define PLATFORM_EXPORT __attribute__((visibility("default"))) -#endif #else // defined(COMPONENT_BUILD) #define PLATFORM_EXPORT #endif -#if defined(_MSC_VER) -// MSVC Compiler warning C4275: -// non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. -// Note that this is intended to be used only when no access to the base class' -// static data is done through derived classes or inline methods. For more info, -// see http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx -// -// This pragma will allow exporting a class that inherits from a non-exported -// base class, anywhere in the Blink platform component. This is only -// a problem when using the MSVC compiler on Windows. -#pragma warning(suppress:4275) -#endif - #endif // PlatformExport_h diff --git a/engine/platform/exported/WebCursorInfo.cpp b/engine/platform/exported/WebCursorInfo.cpp index c2f962bb210..57206edd8fd 100644 --- a/engine/platform/exported/WebCursorInfo.cpp +++ b/engine/platform/exported/WebCursorInfo.cpp @@ -40,9 +40,6 @@ WebCursorInfo::WebCursorInfo(const Cursor& cursor) , hotSpot(cursor.hotSpot()) , imageScaleFactor(cursor.imageScaleFactor()) , customImage(cursor.image()) -#ifdef WIN32 - , externalHandle(0) -#endif { } diff --git a/engine/platform/fonts/FontPlatformData.h b/engine/platform/fonts/FontPlatformData.h index a589f27a6f6..0f65e88253c 100644 --- a/engine/platform/fonts/FontPlatformData.h +++ b/engine/platform/fonts/FontPlatformData.h @@ -23,153 +23,4 @@ */ // FIXME: This is temporary until mac switch to using FontPlatformDataHarfBuzz.h and we merge it with this file. -#if !OS(MACOSX) #include "platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h" - -#else - -#ifndef FontPlatformData_h -#define FontPlatformData_h - -#include "platform/PlatformExport.h" -#include "platform/fonts/FontOrientation.h" -#include "platform/fonts/FontWidthVariant.h" - -OBJC_CLASS NSFont; - -typedef struct CGFont* CGFontRef; -typedef const struct __CTFont* CTFontRef; - -#include -#include - -#include "wtf/Forward.h" -#include "wtf/HashTableDeletedValueType.h" -#include "wtf/PassRefPtr.h" -#include "wtf/RefCounted.h" -#include "wtf/RetainPtr.h" -#include "wtf/text/StringImpl.h" - -#include "platform/fonts/mac/MemoryActivatedFont.h" -#include "third_party/skia/include/core/SkTypeface.h" - -typedef struct CGFont* CGFontRef; -typedef const struct __CTFont* CTFontRef; -typedef UInt32 FMFont; -typedef FMFont ATSUFontID; -typedef UInt32 ATSFontRef; - -namespace blink { - -class HarfBuzzFace; - -inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast(nsFont); } - -class PLATFORM_EXPORT FontPlatformData { -public: - FontPlatformData(WTF::HashTableDeletedValueType); - FontPlatformData(); - FontPlatformData(const FontPlatformData&); - FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); - FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, - FontOrientation = Horizontal, FontWidthVariant = RegularWidth); - FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant); - - ~FontPlatformData(); - - NSFont* font() const { return m_font; } - void setFont(NSFont*); - - CGFontRef cgFont() const { return m_cgFont.get(); } - CTFontRef ctFont() const; - SkTypeface* typeface() const; - - bool roundsGlyphAdvances() const; - bool allowsLigatures() const; - - String fontFamilyName() const; - bool isFixedPitch() const; - float size() const { return m_size; } - void setSize(float size) { m_size = size; } - bool syntheticBold() const { return m_syntheticBold; } - bool syntheticOblique() const { return m_syntheticOblique; } - bool isColorBitmapFont() const { return m_isColorBitmapFont; } - bool isCompositeFontReference() const { return m_isCompositeFontReference; } - - FontOrientation orientation() const { return m_orientation; } - FontWidthVariant widthVariant() const { return m_widthVariant; } - - void setOrientation(FontOrientation orientation) { m_orientation = orientation; } - - HarfBuzzFace* harfBuzzFace(); - - unsigned hash() const - { - ASSERT(m_font || !m_cgFont); - uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast(m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) }; - return StringHasher::hashMemory(hashCodes); - } - - const FontPlatformData& operator=(const FontPlatformData&); - - bool operator==(const FontPlatformData& other) const - { - return platformIsEqual(other) - && m_size == other.m_size - && m_syntheticBold == other.m_syntheticBold - && m_syntheticOblique == other.m_syntheticOblique - && m_isColorBitmapFont == other.m_isColorBitmapFont - && m_isCompositeFontReference == other.m_isCompositeFontReference - && m_orientation == other.m_orientation - && m_widthVariant == other.m_widthVariant; - } - - bool isHashTableDeletedValue() const - { - return m_font == hashTableDeletedFontValue(); - } - -#ifndef NDEBUG - String description() const; -#endif - -private: - bool platformIsEqual(const FontPlatformData&) const; - void platformDataInit(const FontPlatformData&); - const FontPlatformData& platformDataAssign(const FontPlatformData&); -#if OS(MACOSX) - // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters: - // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same - // font as |nsFont|. This because the sandbox may block loading of the original font. - // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont. - // The caller is responsible for calling CFRelease() on this parameter when done with it. - // * cgFont - CGFontRef representing the input font at the specified point size. - void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&); - static NSFont* hashTableDeletedFontValue() { return reinterpret_cast(-1); } -#endif - -public: - bool m_syntheticBold; - bool m_syntheticOblique; - FontOrientation m_orientation; - float m_size; - FontWidthVariant m_widthVariant; - -private: - NSFont* m_font; - RetainPtr m_cgFont; - mutable RetainPtr m_CTFont; - - RefPtr m_inMemoryFont; - RefPtr m_harfBuzzFace; - mutable RefPtr m_typeface; - - bool m_isColorBitmapFont; - bool m_isCompositeFontReference; -}; - -} // namespace blink - -#endif // FontPlatformData_h - -#endif diff --git a/engine/platform/fonts/GlyphPage.h b/engine/platform/fonts/GlyphPage.h index ae7ae6d1d26..e835629e961 100644 --- a/engine/platform/fonts/GlyphPage.h +++ b/engine/platform/fonts/GlyphPage.h @@ -56,11 +56,6 @@ struct GlyphData { const SimpleFontData* fontData; }; -#if COMPILER(MSVC) -#pragma warning(push) -#pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning -#endif - // A GlyphPage contains a fixed-size set of GlyphData mappings for a contiguous // range of characters in the Unicode code space. GlyphPages are indexed // starting from 0 and incrementing for each 256 glyphs. @@ -218,10 +213,6 @@ private: const SimpleFontData* m_perGlyphFontData[0]; }; -#if COMPILER(MSVC) -#pragma warning(pop) -#endif - } // namespace blink #endif // GlyphPage_h diff --git a/engine/platform/graphics/Color.cpp b/engine/platform/graphics/Color.cpp index bd88d5de3d1..de8789871f8 100644 --- a/engine/platform/graphics/Color.cpp +++ b/engine/platform/graphics/Color.cpp @@ -35,7 +35,6 @@ namespace blink { -#if !COMPILER(MSVC) // FIXME: Use C++11 strong enums to avoid static data member with initializer definition problems. const RGBA32 Color::black; const RGBA32 Color::white; @@ -43,7 +42,6 @@ const RGBA32 Color::darkGray; const RGBA32 Color::gray; const RGBA32 Color::lightGray; const RGBA32 Color::transparent; -#endif static const RGBA32 lightenedBlack = 0xFF545454; static const RGBA32 darkenedWhite = 0xFFABABAB; diff --git a/engine/platform/graphics/Image.h b/engine/platform/graphics/Image.h index a7222231d38..e3dd65958c9 100644 --- a/engine/platform/graphics/Image.h +++ b/engine/platform/graphics/Image.h @@ -38,7 +38,6 @@ #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" #include "wtf/RefPtr.h" -#include "wtf/RetainPtr.h" #include "wtf/text/WTFString.h" namespace blink { diff --git a/engine/platform/transforms/TransformationMatrix.h b/engine/platform/transforms/TransformationMatrix.h index 660fa763b95..8ca357c7be0 100644 --- a/engine/platform/transforms/TransformationMatrix.h +++ b/engine/platform/transforms/TransformationMatrix.h @@ -51,11 +51,7 @@ class PLATFORM_EXPORT TransformationMatrix { public: #if CPU(APPLE_ARMV7S) || defined(TRANSFORMATION_MATRIX_USE_X86_64_SSE2) -#if COMPILER(MSVC) - __declspec(align(16)) typedef double Matrix4[4][4]; -#else typedef double Matrix4[4][4] __attribute__((aligned (16))); -#endif #else typedef double Matrix4[4][4]; #endif diff --git a/engine/platform/weborigin/KURL.cpp b/engine/platform/weborigin/KURL.cpp index 5d4e536c13f..f7e15855e6a 100644 --- a/engine/platform/weborigin/KURL.cpp +++ b/engine/platform/weborigin/KURL.cpp @@ -261,7 +261,6 @@ KURL& KURL::operator=(const KURL& other) return *this; } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) KURL::KURL(KURL&& other) : m_isValid(other.m_isValid) , m_protocolIsInHTTPFamily(other.m_protocolIsInHTTPFamily) @@ -284,7 +283,6 @@ KURL& KURL::operator=(KURL&& other) m_innerURL = other.m_innerURL.release(); return *this; } -#endif KURL KURL::copy() const { diff --git a/engine/platform/weborigin/KURL.h b/engine/platform/weborigin/KURL.h index ded81221ee0..82a807a3b6f 100644 --- a/engine/platform/weborigin/KURL.h +++ b/engine/platform/weborigin/KURL.h @@ -50,10 +50,8 @@ public: KURL(const KURL&); KURL& operator=(const KURL&); -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) KURL(KURL&&); KURL& operator=(KURL&&); -#endif // The argument is an absolute URL string. The string is assumed to be // output of KURL::string() called on a valid KURL object, or indiscernible diff --git a/engine/public/platform/Platform.h b/engine/public/platform/Platform.h index ede4a519d79..90e427a2ac5 100644 --- a/engine/public/platform/Platform.h +++ b/engine/public/platform/Platform.h @@ -31,10 +31,6 @@ #ifndef Platform_h #define Platform_h -#ifdef WIN32 -#include -#endif - #include "WebCommon.h" #include "WebData.h" #include "WebGestureDevice.h" @@ -80,12 +76,7 @@ struct WebSize; class Platform { public: // HTML5 Database ------------------------------------------------------ - -#ifdef WIN32 - typedef HANDLE FileHandle; -#else typedef int FileHandle; -#endif BLINK_PLATFORM_EXPORT static void initialize(Platform*); BLINK_PLATFORM_EXPORT static void shutdown(); diff --git a/engine/public/platform/WebCommon.h b/engine/public/platform/WebCommon.h index 9967267124f..501f1d6cb77 100644 --- a/engine/public/platform/WebCommon.h +++ b/engine/public/platform/WebCommon.h @@ -44,27 +44,9 @@ #endif #if defined(COMPONENT_BUILD) - #if defined(WIN32) - #if BLINK_IMPLEMENTATION - #define BLINK_EXPORT __declspec(dllexport) - #else // BLINK_IMPLEMENTATION - #define BLINK_EXPORT __declspec(dllimport) - #endif - #if BLINK_PLATFORM_IMPLEMENTATION - #define BLINK_PLATFORM_EXPORT __declspec(dllexport) - #else // BLINK_PLATFORM_IMPLEMENTATION - #define BLINK_PLATFORM_EXPORT __declspec(dllimport) - #endif - #if BLINK_COMMON_IMPLEMENTATION - #define BLINK_COMMON_EXPORT __declspec(dllexport) - #else // BLINK_COMMON_IMPLEMENTATION - #define BLINK_COMMON_EXPORT __declspec(dllimport) - #endif - #else // defined(WIN32) - #define BLINK_EXPORT __attribute__((visibility("default"))) - #define BLINK_PLATFORM_EXPORT __attribute__((visibility("default"))) - #define BLINK_COMMON_EXPORT __attribute__((visibility("default"))) - #endif + #define BLINK_EXPORT __attribute__((visibility("default"))) + #define BLINK_PLATFORM_EXPORT __attribute__((visibility("default"))) + #define BLINK_COMMON_EXPORT __attribute__((visibility("default"))) #else // defined(COMPONENT_BUILD) #define BLINK_EXPORT #define BLINK_PLATFORM_EXPORT @@ -76,17 +58,7 @@ // Basic types #include // For size_t - -#if defined(WIN32) -// Visual Studio doesn't have stdint.h. -typedef short int16_t; -typedef unsigned short uint16_t; -typedef int int32_t; -typedef unsigned int uint32_t; -typedef unsigned __int64 uint64_t; -#else #include // For int32_t -#endif namespace blink { @@ -94,11 +66,7 @@ namespace blink { typedef int32_t WebUChar32; // UTF-16 character type -#if defined(WIN32) -typedef wchar_t WebUChar; -#else typedef unsigned short WebUChar; -#endif // Latin-1 character type typedef unsigned char WebLChar; diff --git a/engine/wtf/Alignment.h b/engine/wtf/Alignment.h index 4a028c45a92..f21077b4fa0 100644 --- a/engine/wtf/Alignment.h +++ b/engine/wtf/Alignment.h @@ -30,9 +30,6 @@ namespace WTF { #if COMPILER(GCC) #define WTF_ALIGN_OF(type) __alignof__(type) #define WTF_ALIGNED(variable_type, variable, n) variable_type variable __attribute__((__aligned__(n))) -#elif COMPILER(MSVC) - #define WTF_ALIGN_OF(type) __alignof(type) - #define WTF_ALIGNED(variable_type, variable, n) __declspec(align(n)) variable_type variable #else #error WTF_ALIGN macros need alignment control. #endif diff --git a/engine/wtf/Assertions.cpp b/engine/wtf/Assertions.cpp index b28511eb63b..f737e129d7a 100644 --- a/engine/wtf/Assertions.cpp +++ b/engine/wtf/Assertions.cpp @@ -70,7 +70,7 @@ static void vprintf_stderr_common(const char* format, va_list args) vfprintf(stderr, format, args); } -#if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) +#if COMPILER(CLANG) || COMPILER(GCC) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" #endif @@ -103,7 +103,7 @@ static void vprintf_stderr_with_trailing_newline(const char* format, va_list arg vprintf_stderr_common(formatWithNewline.get(), args); } -#if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) +#if COMPILER(CLANG) || COMPILER(GCC) #pragma GCC diagnostic pop #endif diff --git a/engine/wtf/Assertions.h b/engine/wtf/Assertions.h index 9922cc7fa26..bd88ebc987f 100644 --- a/engine/wtf/Assertions.h +++ b/engine/wtf/Assertions.h @@ -282,14 +282,8 @@ while (0) /* COMPILE_ASSERT */ #ifndef COMPILE_ASSERT -#if COMPILER_SUPPORTS(C_STATIC_ASSERT) /* Unlike static_assert below, this also works in plain C code. */ #define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) -#elif COMPILER_SUPPORTS(CXX_STATIC_ASSERT) -#define COMPILE_ASSERT(exp, name) static_assert((exp), #name) -#else -#define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1] -#endif #endif /* FATAL */ diff --git a/engine/wtf/Atomics.h b/engine/wtf/Atomics.h index aaad9c9e90c..343d3065963 100644 --- a/engine/wtf/Atomics.h +++ b/engine/wtf/Atomics.h @@ -35,51 +35,12 @@ #include -#if COMPILER(MSVC) -#include -#endif - #if defined(THREAD_SANITIZER) #include #endif namespace WTF { -#if COMPILER(MSVC) - -// atomicAdd returns the result of the addition. -ALWAYS_INLINE int atomicAdd(int volatile* addend, int increment) -{ - return InterlockedExchangeAdd(reinterpret_cast(addend), static_cast(increment)) + increment; -} - -// atomicSubtract returns the result of the subtraction. -ALWAYS_INLINE int atomicSubtract(int volatile* addend, int decrement) -{ - return InterlockedExchangeAdd(reinterpret_cast(addend), static_cast(-decrement)) - decrement; -} - -ALWAYS_INLINE int atomicIncrement(int volatile* addend) { return InterlockedIncrement(reinterpret_cast(addend)); } -ALWAYS_INLINE int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast(addend)); } - -ALWAYS_INLINE int64_t atomicIncrement(int64_t volatile* addend) { return InterlockedIncrement64(reinterpret_cast(addend)); } -ALWAYS_INLINE int64_t atomicDecrement(int64_t volatile* addend) { return InterlockedDecrement64(reinterpret_cast(addend)); } - -ALWAYS_INLINE int atomicTestAndSetToOne(int volatile* ptr) -{ - int ret = InterlockedExchange(reinterpret_cast(ptr), 1); - ASSERT(!ret || ret == 1); - return ret; -} - -ALWAYS_INLINE void atomicSetOneToZero(int volatile* ptr) -{ - ASSERT(*ptr == 1); - InterlockedExchange(reinterpret_cast(ptr), 0); -} - -#else - // atomicAdd returns the result of the addition. ALWAYS_INLINE int atomicAdd(int volatile* addend, int increment) { return __sync_add_and_fetch(addend, increment); } // atomicSubtract returns the result of the subtraction. @@ -103,7 +64,6 @@ ALWAYS_INLINE void atomicSetOneToZero(int volatile* ptr) ASSERT(*ptr == 1); __sync_lock_release(ptr); } -#endif #if defined(THREAD_SANITIZER) ALWAYS_INLINE void releaseStore(volatile int* ptr, int value) @@ -129,14 +89,7 @@ ALWAYS_INLINE unsigned acquireLoad(volatile const unsigned* ptr) #if CPU(X86) || CPU(X86_64) // Only compiler barrier is needed. -#if COMPILER(MSVC) -// Starting from Visual Studio 2005 compiler guarantees acquire and release -// semantics for operations on volatile variables. See MSDN entry for -// MemoryBarrier macro. -#define MEMORY_BARRIER() -#else #define MEMORY_BARRIER() __asm__ __volatile__("" : : : "memory") -#endif #elif CPU(ARM) && (OS(LINUX) || OS(ANDROID)) // On ARM __sync_synchronize generates dmb which is very expensive on single // core devices which don't actually need it. Avoid the cost by calling into diff --git a/engine/wtf/BUILD.gn b/engine/wtf/BUILD.gn index fff0d94ab02..028cc5e12cb 100644 --- a/engine/wtf/BUILD.gn +++ b/engine/wtf/BUILD.gn @@ -87,7 +87,6 @@ component("wtf") { "NonCopyingSort.h", "Noncopyable.h", "NotFound.h", - "NullPtr.cpp", "NullPtr.h", "OwnPtr.h", "OwnPtrCommon.h", @@ -105,7 +104,6 @@ component("wtf") { "RefCountedLeakCounter.cpp", "RefCountedLeakCounter.h", "RefPtr.h", - "RetainPtr.h", "SaturatedArithmetic.h", "SizeLimits.cpp", "SpinLock.h", diff --git a/engine/wtf/BitwiseOperations.h b/engine/wtf/BitwiseOperations.h index 4808efeda69..41c14acde04 100644 --- a/engine/wtf/BitwiseOperations.h +++ b/engine/wtf/BitwiseOperations.h @@ -42,32 +42,9 @@ #include -#if COMPILER(MSVC) -#include -#endif - namespace WTF { -#if COMPILER(MSVC) - -ALWAYS_INLINE uint32_t countLeadingZeros32(uint32_t x) -{ - unsigned long index; - return LIKELY(_BitScanReverse(&index, x)) ? (31 - index) : 32; -} - -#if CPU(64BIT) - -// MSVC only supplies _BitScanForward64 when building for a 64-bit target. -ALWAYS_INLINE uint64_t countLeadingZeros64(uint64_t x) -{ - unsigned long index; - return LIKELY(_BitScanReverse64(&index, x)) ? (63 - index) : 64; -} - -#endif - -#elif COMPILER(GCC) +#if COMPILER(GCC) // This is very annoying. __builtin_clz has undefined behaviour for an input of // 0, even though these's clearly a return value that makes sense, and even diff --git a/engine/wtf/ByteSwap.h b/engine/wtf/ByteSwap.h index ddc0e8fe432..51012b93da5 100644 --- a/engine/wtf/ByteSwap.h +++ b/engine/wtf/ByteSwap.h @@ -36,22 +36,10 @@ #include -#if COMPILER(MSVC) -#include -#endif - namespace WTF { inline uint32_t wswap32(uint32_t x) { return ((x & 0xffff0000) >> 16) | ((x & 0x0000ffff) << 16); } -#if COMPILER(MSVC) - -ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return _byteswap_uint64(x); } -ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return _byteswap_ulong(x); } -ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return _byteswap_ushort(x); } - -#else - ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return __builtin_bswap64(x); } ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return __builtin_bswap32(x); } // GCC 4.6 lacks __builtin_bswap16. Newer versions have it but we support 4.6. @@ -61,8 +49,6 @@ ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return __builtin_bswap16(x); } inline uint16_t bswap16(uint16_t x) { return ((x & 0xff00) >> 8) | ((x & 0x00ff) << 8); } #endif -#endif - #if CPU(64BIT) ALWAYS_INLINE size_t bswapuintptrt(size_t x) { return bswap64(x); } diff --git a/engine/wtf/CPU.h b/engine/wtf/CPU.h index 061d128afab..4115ed1b0b7 100644 --- a/engine/wtf/CPU.h +++ b/engine/wtf/CPU.h @@ -70,7 +70,6 @@ #elif !defined(__ARM_EABI__) \ && !defined(__EABI__) \ && !defined(__VFP_FP__) \ - && !defined(_WIN32_WCE) \ && !defined(ANDROID) #define WTF_CPU_MIDDLE_ENDIAN 1 @@ -159,7 +158,7 @@ #define WTF_CPU_ARM_NEON 1 #endif -#if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0)) +#if CPU(ARM_NEON) // All NEON intrinsics usage can be disabled by this macro. #define HAVE_ARM_NEON_INTRINSICS 1 #endif diff --git a/engine/wtf/Compiler.h b/engine/wtf/Compiler.h index ff35d100894..8efdaf2e8eb 100644 --- a/engine/wtf/Compiler.h +++ b/engine/wtf/Compiler.h @@ -29,12 +29,6 @@ /* COMPILER() - the compiler being used to build the project */ #define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE) -/* COMPILER_SUPPORTS() - whether the compiler being used to build the project supports the given feature. */ -#define COMPILER_SUPPORTS(WTF_COMPILER_FEATURE) (defined WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE && WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE) - -/* COMPILER_QUIRK() - whether the compiler being used to build the project requires a given quirk. */ -#define COMPILER_QUIRK(WTF_COMPILER_QUIRK) (defined WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK && WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK) - /* ==== COMPILER() - the compiler being used to build the project ==== */ /* COMPILER(CLANG) - Clang */ @@ -42,45 +36,12 @@ #define WTF_COMPILER_CLANG 1 #define CLANG_PRAGMA(PRAGMA) _Pragma(PRAGMA) - -/* Specific compiler features */ -#define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES __has_extension(cxx_variadic_templates) - -/* There is a bug in clang that comes with Xcode 4.2 where AtomicStrings can't be implicitly converted to Strings - in the presence of move constructors and/or move assignment operators. This bug has been fixed in Xcode 4.3 clang, so we - check for both cxx_rvalue_references as well as the unrelated cxx_nonstatic_member_init feature which we know was added in 4.3 */ -#define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES __has_extension(cxx_rvalue_references) && __has_extension(cxx_nonstatic_member_init) - -#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR __has_feature(cxx_nullptr) -#define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS __has_feature(cxx_explicit_conversions) -#define WTF_COMPILER_SUPPORTS_BLOCKS __has_feature(blocks) -#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_extension(c_static_assert) -#define WTF_COMPILER_SUPPORTS_CXX_STATIC_ASSERT __has_extension(cxx_static_assert) -#define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_extension(has_trivial_destructor) -#define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_extension(cxx_strong_enums) - #endif #ifndef CLANG_PRAGMA #define CLANG_PRAGMA(PRAGMA) #endif -/* COMPILER(MSVC) - Microsoft Visual C++ */ -#if defined(_MSC_VER) -#define WTF_COMPILER_MSVC 1 - -/* Specific compiler features */ -#if !COMPILER(CLANG) && _MSC_VER >= 1600 -#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 -#endif - -#if COMPILER(CLANG) -/* Keep strong enums turned off when building with clang-cl: We cannot yet build all of Blink without fallback to cl.exe, and strong enums are exposed at ABI boundaries. */ -#undef WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS -#endif - -#endif - /* COMPILER(GCC) - GNU Compiler Collection */ #if defined(__GNUC__) #define WTF_COMPILER_GCC 1 @@ -91,40 +52,14 @@ #define GCC_VERSION_AT_LEAST(major, minor, patch) 0 #endif -/* Specific compiler features */ -#if COMPILER(GCC) && !COMPILER(CLANG) -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -/* C11 support */ -#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT 1 -#endif -#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L) -/* C++11 support */ -#if GCC_VERSION_AT_LEAST(4, 3, 0) -#define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 1 -#define WTF_COMPILER_SUPPORTS_CXX_STATIC_ASSERT 1 -#define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES 1 -#endif -#if GCC_VERSION_AT_LEAST(4, 5, 0) -#define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1 -#endif -#if GCC_VERSION_AT_LEAST(4, 6, 0) -#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 -/* Strong enums should work from gcc 4.4, but doesn't seem to support some operators */ -#define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1 -#endif -#endif /* defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L) */ -#endif /* COMPILER(GCC) */ - /* ==== Compiler features ==== */ /* ALWAYS_INLINE */ #ifndef ALWAYS_INLINE -#if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) +#if COMPILER(GCC) && defined(NDEBUG) #define ALWAYS_INLINE inline __attribute__((__always_inline__)) -#elif COMPILER(MSVC) && defined(NDEBUG) -#define ALWAYS_INLINE __forceinline #else #define ALWAYS_INLINE inline #endif @@ -136,8 +71,6 @@ #ifndef NEVER_INLINE #if COMPILER(GCC) #define NEVER_INLINE __attribute__((__noinline__)) -#elif COMPILER(MSVC) -#define NEVER_INLINE __declspec(noinline) #else #define NEVER_INLINE #endif @@ -172,8 +105,6 @@ #ifndef NO_RETURN #if COMPILER(GCC) #define NO_RETURN __attribute((__noreturn__)) -#elif COMPILER(MSVC) -#define NO_RETURN __declspec(noreturn) #else #define NO_RETURN #endif @@ -209,24 +140,10 @@ #endif #endif -/* OBJC_CLASS */ - -#ifndef OBJC_CLASS -#ifdef __OBJC__ -#define OBJC_CLASS @class -#else -#define OBJC_CLASS class -#endif -#endif - /* WTF_PRETTY_FUNCTION */ #if COMPILER(GCC) -#define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 #define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ -#elif COMPILER(MSVC) -#define WTF_COMPILER_SUPPORTS_PRETTY_FUNCTION 1 -#define WTF_PRETTY_FUNCTION __FUNCSIG__ #else #define WTF_PRETTY_FUNCTION __FUNCTION__ #endif diff --git a/engine/wtf/EnumClass.h b/engine/wtf/EnumClass.h index 33e3884d19d..4fda5a779ef 100644 --- a/engine/wtf/EnumClass.h +++ b/engine/wtf/EnumClass.h @@ -53,82 +53,12 @@ namespace WTF { // The ENUM_CLASS macros will use C++11's enum class if the compiler supports it. // Otherwise, it will use the EnumClass template below. -#if COMPILER_SUPPORTS(CXX_STRONG_ENUMS) #define ENUM_CLASS(__enumName) \ enum class __enumName #define ENUM_CLASS_END(__enumName) -#else // !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) - -// How to define a type safe enum list using the EnumClass template? -// ================================================================ -// Definition should be a struct that encapsulates an enum list. -// The enum list should be names Enums. -// -// Here's an example of how to define a type safe enum named MyEnum using -// the EnumClass template: -// -// struct MyEnumDefinition { -// enum Enums { -// ValueDefault, -// Value1, -// ... -// ValueN -// }; -// }; -// typedef EnumClass MyEnum; -// -// With that, you can now use MyEnum enum values as follow: -// -// MyEnum value1; // value1 is assigned MyEnum::ValueDefault by default. -// MyEnum value2 = MyEnum::Value1; // value2 is assigned MyEnum::Value1; - -template -class EnumClass : public Definition { - typedef enum Definition::Enums Value; -public: - ALWAYS_INLINE EnumClass() { } - ALWAYS_INLINE EnumClass(Value value) : m_value(value) { } - - ALWAYS_INLINE Value value() const { return m_value; } - - ALWAYS_INLINE bool operator==(const EnumClass other) { return m_value == other.m_value; } - ALWAYS_INLINE bool operator!=(const EnumClass other) { return m_value != other.m_value; } - ALWAYS_INLINE bool operator<(const EnumClass other) { return m_value < other.m_value; } - ALWAYS_INLINE bool operator<=(const EnumClass other) { return m_value <= other.m_value; } - ALWAYS_INLINE bool operator>(const EnumClass other) { return m_value > other.m_value; } - ALWAYS_INLINE bool operator>=(const EnumClass other) { return m_value >= other.m_value; } - - ALWAYS_INLINE bool operator==(const Value value) { return m_value == value; } - ALWAYS_INLINE bool operator!=(const Value value) { return m_value != value; } - ALWAYS_INLINE bool operator<(const Value value) { return m_value < value; } - ALWAYS_INLINE bool operator<=(const Value value) { return m_value <= value; } - ALWAYS_INLINE bool operator>(const Value value) { return m_value > value; } - ALWAYS_INLINE bool operator>=(const Value value) { return m_value >= value; } - - ALWAYS_INLINE operator Value() { return m_value; } - -private: - Value m_value; -}; - -#define ENUM_CLASS(__enumName) \ - struct __enumName ## Definition { \ - enum Enums - -#define ENUM_CLASS_END(__enumName) \ - ; \ - }; \ - typedef EnumClass< __enumName ## Definition > __enumName - -#endif // !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) - } // namespace WTF -#if !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) -using WTF::EnumClass; -#endif - #endif // WTF_EnumClass_h diff --git a/engine/wtf/HashFunctions.h b/engine/wtf/HashFunctions.h index 522bfd776bb..f0b2fbbbfb8 100644 --- a/engine/wtf/HashFunctions.h +++ b/engine/wtf/HashFunctions.h @@ -124,14 +124,7 @@ namespace WTF { template struct PtrHash { static unsigned hash(T key) { -#if COMPILER(MSVC) -#pragma warning(push) -#pragma warning(disable: 4244) // work around what seems to be a bug in MSVC's conversion warnings -#endif return IntHash::hash(reinterpret_cast(key)); -#if COMPILER(MSVC) -#pragma warning(pop) -#endif } static bool equal(T a, T b) { return a == b; } static bool equal(std::nullptr_t, T b) { return b == 0; } @@ -205,11 +198,7 @@ namespace WTF { template<> struct DefaultHash { typedef IntHash Hash; }; template<> struct DefaultHash { typedef IntHash Hash; }; template<> struct DefaultHash { typedef IntHash Hash; }; - -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) template<> struct DefaultHash { typedef IntHash Hash; }; -#endif - template<> struct DefaultHash { typedef FloatHash Hash; }; template<> struct DefaultHash { typedef FloatHash Hash; }; diff --git a/engine/wtf/InstanceCounter.cpp b/engine/wtf/InstanceCounter.cpp index e37958227e5..21643615fd1 100644 --- a/engine/wtf/InstanceCounter.cpp +++ b/engine/wtf/InstanceCounter.cpp @@ -43,9 +43,6 @@ const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; #elif COMPILER(GCC) const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractNameFunction() [with T = ") - 1; const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; -#elif COMPILER(MSVC) -const size_t extractNameFunctionPrefixLength = sizeof("const char *__cdecl WTF::extractNameFunction(void)") - 1; #else #warning "Extracting typename is supported only in compiler GCC, CLANG and MSVC at this moment" #endif @@ -54,7 +51,7 @@ const size_t extractNameFunctionPostfixLength = sizeof(">(void)") - 1; // The result of extractNameFunction() is given as |funcName|. |extractTypeNameFromFunctionName| then extracts a typename string from |funcName|. String extractTypeNameFromFunctionName(const char* funcName) { -#if COMPILER(CLANG) || COMPILER(GCC) || COMPILER(MSVC) +#if COMPILER(CLANG) || COMPILER(GCC) size_t funcNameLength = strlen(funcName); ASSERT(funcNameLength > extractNameFunctionPrefixLength + extractNameFunctionPostfixLength); diff --git a/engine/wtf/NullPtr.cpp b/engine/wtf/NullPtr.cpp deleted file mode 100644 index 4f6bfa39d03..00000000000 --- a/engine/wtf/NullPtr.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include "config.h" -#include "NullPtr.h" - -#if !(COMPILER_SUPPORTS(CXX_NULLPTR) || defined(_LIBCPP_VERSION)) - -const std::nullptr_t nullptr; - -#endif diff --git a/engine/wtf/NullPtr.h b/engine/wtf/NullPtr.h index 9614104e976..ccc9014fd57 100644 --- a/engine/wtf/NullPtr.h +++ b/engine/wtf/NullPtr.h @@ -27,45 +27,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef NullPtr_h #define NullPtr_h -// For compilers and standard libraries that do not yet include it, this adds the -// nullptr_t type and nullptr object. They are defined in the same namespaces they -// would be in compiler and library that had the support. - -#if COMPILER_SUPPORTS(CXX_NULLPTR) || defined(_LIBCPP_VERSION) - -// libstdc++ supports nullptr_t starting with gcc 4.6. STLport doesn't define it. -#if (defined(__GLIBCXX__) && __GLIBCXX__ < 20110325) || defined(_STLPORT_VERSION) -namespace std { -typedef decltype(nullptr) nullptr_t; -} -#endif - -#else - -#include "wtf/WTFExport.h" - -namespace std { -class nullptr_t { -public: - // Required in order to create const nullptr_t objects without an - // explicit initializer in GCC 4.5, a la: - // - // const std::nullptr_t nullptr; - nullptr_t() { } - - // Make nullptr convertible to any pointer type. - template operator T*() const { return 0; } - // Make nullptr convertible to any member pointer type. - template operator T C::*() { return 0; } -private: - // Do not allow taking the address of nullptr. - void operator&(); -}; -} -WTF_EXPORT extern const std::nullptr_t nullptr; - -#endif - #define WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(ClassName) \ private: \ ClassName(int) = delete diff --git a/engine/wtf/OwnPtr.h b/engine/wtf/OwnPtr.h index a923b152973..6acbc418a06 100644 --- a/engine/wtf/OwnPtr.h +++ b/engine/wtf/OwnPtr.h @@ -33,11 +33,9 @@ namespace WTF { template class PassOwnPtr; template class OwnPtr { -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) // If rvalue references are not supported, the copy constructor is // public so OwnPtr cannot be marked noncopyable. See note below. WTF_MAKE_NONCOPYABLE(OwnPtr); -#endif WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(OwnPtr); public: typedef typename RemoveExtent::Type ValueType; @@ -54,14 +52,6 @@ namespace WTF { OwnPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); } -#if !COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) - // This copy constructor is used implicitly by gcc when it generates - // transients for assigning a PassOwnPtr object to a stack-allocated - // OwnPtr object. It should never be called explicitly and gcc - // should optimize away the constructor when generating code. - OwnPtr(const OwnPtr&); -#endif - ~OwnPtr() { OwnedPtrDeleter::deletePtr(m_ptr); @@ -89,24 +79,17 @@ namespace WTF { OwnPtr& operator=(std::nullptr_t) { clear(); return *this; } template OwnPtr& operator=(const PassOwnPtr&); -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) OwnPtr(OwnPtr&&); template OwnPtr(OwnPtr&&); OwnPtr& operator=(OwnPtr&&); template OwnPtr& operator=(OwnPtr&&); -#endif void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); } static T* hashTableDeletedValue() { return reinterpret_cast(-1); } private: -#if !COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) - // If rvalue references are supported, noncopyable takes care of this. - OwnPtr& operator=(const OwnPtr&); -#endif - // We should never have two OwnPtrs for the same underlying object (otherwise we'll get // double-destruction), so these equality operators should never be needed. template bool operator==(const OwnPtr&) const { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; } @@ -176,7 +159,6 @@ namespace WTF { return *this; } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) template inline OwnPtr::OwnPtr(OwnPtr&& o) : m_ptr(o.leakPtr()) { @@ -208,7 +190,6 @@ namespace WTF { return *this; } -#endif template inline void swap(OwnPtr& a, OwnPtr& b) { diff --git a/engine/wtf/RefPtr.h b/engine/wtf/RefPtr.h index 5b0ea80ca50..a8c17270608 100644 --- a/engine/wtf/RefPtr.h +++ b/engine/wtf/RefPtr.h @@ -44,10 +44,8 @@ namespace WTF { ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { refIfNotNull(m_ptr); } template RefPtr(const RefPtr& o, EnsurePtrConvertibleArgDecl(U, T)) : m_ptr(o.get()) { refIfNotNull(m_ptr); } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) RefPtr(RefPtr&& o) : m_ptr(o.m_ptr) { o.m_ptr = 0; } RefPtr& operator=(RefPtr&&); -#endif // See comments in PassRefPtr.h for an explanation of why this takes a const reference. template RefPtr(const PassRefPtr&, EnsurePtrConvertibleArgDecl(U, T)); @@ -108,7 +106,6 @@ namespace WTF { return *this; } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) template inline RefPtr& RefPtr::operator=(RefPtr&& o) { // FIXME: Instead of explicitly casting to RefPtr&& here, we should use std::move, but that requires us to @@ -117,7 +114,6 @@ namespace WTF { swap(ptr); return *this; } -#endif template template inline RefPtr& RefPtr::operator=(const RefPtr& o) { diff --git a/engine/wtf/RefPtrTest.cpp b/engine/wtf/RefPtrTest.cpp index 29ebedf7a95..c7b2655fd9f 100644 --- a/engine/wtf/RefPtrTest.cpp +++ b/engine/wtf/RefPtrTest.cpp @@ -20,7 +20,6 @@ TEST(RefPtrTest, Basic) EXPECT_TRUE(!string); } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) TEST(RefPtrTest, MoveAssignmentOperator) { RefPtr a = StringImpl::create("a"); @@ -31,6 +30,5 @@ TEST(RefPtrTest, MoveAssignmentOperator) EXPECT_TRUE(!!b); EXPECT_TRUE(!a); } -#endif } diff --git a/engine/wtf/RetainPtr.h b/engine/wtf/RetainPtr.h deleted file mode 100644 index 9e5bbc6273b..00000000000 --- a/engine/wtf/RetainPtr.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef RetainPtr_h -#define RetainPtr_h - -#include "wtf/HashTableDeletedValueType.h" -#include "wtf/HashTraits.h" -#include "wtf/NullPtr.h" -#include "wtf/TypeTraits.h" -#include - -#if USE(CF) -#include -#endif - -#ifdef __OBJC__ -#import -#endif - -#ifndef CF_RELEASES_ARGUMENT -#define CF_RELEASES_ARGUMENT -#endif - -#ifndef NS_RELEASES_ARGUMENT -#define NS_RELEASES_ARGUMENT -#endif - -namespace WTF { - - // Unlike most most of our smart pointers, RetainPtr can take either the pointer type or the pointed-to type, - // so both RetainPtr and RetainPtr will work. - - enum AdoptCFTag { AdoptCF }; - enum AdoptNSTag { AdoptNS }; - -#ifdef __OBJC__ - inline void adoptNSReference(id ptr) - { - if (ptr) { - CFRetain(ptr); - [ptr release]; - } - } -#endif - - template class RetainPtr { - public: - typedef typename RemovePointer::Type ValueType; - typedef ValueType* PtrType; - - RetainPtr() : m_ptr(0) {} - RetainPtr(PtrType ptr) : m_ptr(ptr) { if (ptr) CFRetain(ptr); } - - RetainPtr(AdoptCFTag, PtrType ptr) : m_ptr(ptr) { } - RetainPtr(AdoptNSTag, PtrType ptr) : m_ptr(ptr) { adoptNSReference(ptr); } - - RetainPtr(const RetainPtr& o) : m_ptr(o.m_ptr) { if (PtrType ptr = m_ptr) CFRetain(ptr); } - -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) - RetainPtr(RetainPtr&& o) : m_ptr(o.leakRef()) { } -#endif - - // Hash table deleted values, which are only constructed and never copied or destroyed. - RetainPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } - bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); } - - ~RetainPtr() { if (PtrType ptr = m_ptr) CFRelease(ptr); } - - template RetainPtr(const RetainPtr&); - - void clear(); - PtrType leakRef() WARN_UNUSED_RETURN; - - PtrType get() const { return m_ptr; } - PtrType operator->() const { return m_ptr; } -#if COMPILER_SUPPORTS(CXX_EXPLICIT_CONVERSIONS) - explicit operator PtrType() const { return m_ptr; } -#endif - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to other integer types. - typedef PtrType RetainPtr::*UnspecifiedBoolType; - operator UnspecifiedBoolType() const { return m_ptr ? &RetainPtr::m_ptr : 0; } - - RetainPtr& operator=(const RetainPtr&); - template RetainPtr& operator=(const RetainPtr&); - RetainPtr& operator=(PtrType); - template RetainPtr& operator=(U*); - -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) - RetainPtr& operator=(RetainPtr&&); - template RetainPtr& operator=(RetainPtr&&); -#endif - -#if !COMPILER_SUPPORTS(CXX_NULLPTR) - RetainPtr& operator=(std::nullptr_t) { clear(); return *this; } -#endif - - void adoptCF(PtrType); - void adoptNS(PtrType); - - void swap(RetainPtr&); - - private: - static PtrType hashTableDeletedValue() { return reinterpret_cast(-1); } - - PtrType m_ptr; - }; - - template template inline RetainPtr::RetainPtr(const RetainPtr& o) - : m_ptr(o.get()) - { - if (PtrType ptr = m_ptr) - CFRetain(ptr); - } - - template inline void RetainPtr::clear() - { - if (PtrType ptr = m_ptr) { - m_ptr = 0; - CFRelease(ptr); - } - } - - template inline typename RetainPtr::PtrType RetainPtr::leakRef() - { - PtrType ptr = m_ptr; - m_ptr = 0; - return ptr; - } - - template inline RetainPtr& RetainPtr::operator=(const RetainPtr& o) - { - PtrType optr = o.get(); - if (optr) - CFRetain(optr); - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - return *this; - } - - template template inline RetainPtr& RetainPtr::operator=(const RetainPtr& o) - { - PtrType optr = o.get(); - if (optr) - CFRetain(optr); - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - return *this; - } - - template inline RetainPtr& RetainPtr::operator=(PtrType optr) - { - if (optr) - CFRetain(optr); - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - return *this; - } - - template template inline RetainPtr& RetainPtr::operator=(U* optr) - { - if (optr) - CFRetain(optr); - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - return *this; - } - -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) - template inline RetainPtr& RetainPtr::operator=(RetainPtr&& o) - { - adoptCF(o.leakRef()); - return *this; - } - - template template inline RetainPtr& RetainPtr::operator=(RetainPtr&& o) - { - adoptCF(o.leakRef()); - return *this; - } -#endif - - template inline void RetainPtr::adoptCF(PtrType optr) - { - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - } - - template inline void RetainPtr::adoptNS(PtrType optr) - { - adoptNSReference(optr); - - PtrType ptr = m_ptr; - m_ptr = optr; - if (ptr) - CFRelease(ptr); - } - - template inline void RetainPtr::swap(RetainPtr& o) - { - std::swap(m_ptr, o.m_ptr); - } - - template inline void swap(RetainPtr& a, RetainPtr& b) - { - a.swap(b); - } - - template inline bool operator==(const RetainPtr& a, const RetainPtr& b) - { - return a.get() == b.get(); - } - - template inline bool operator==(const RetainPtr& a, U* b) - { - return a.get() == b; - } - - template inline bool operator==(T* a, const RetainPtr& b) - { - return a == b.get(); - } - - template inline bool operator!=(const RetainPtr& a, const RetainPtr& b) - { - return a.get() != b.get(); - } - - template inline bool operator!=(const RetainPtr& a, U* b) - { - return a.get() != b; - } - - template inline bool operator!=(T* a, const RetainPtr& b) - { - return a != b.get(); - } - - template inline RetainPtr adoptCF(T CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; - template inline RetainPtr adoptCF(T o) - { - return RetainPtr(AdoptCF, o); - } - - template inline RetainPtr adoptNS(T NS_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; - template inline RetainPtr adoptNS(T o) - { - return RetainPtr(AdoptNS, o); - } - - // Helper function for creating a RetainPtr using template argument deduction. - template inline RetainPtr retainPtr(T) WARN_UNUSED_RETURN; - template inline RetainPtr retainPtr(T o) - { - return RetainPtr(o); - } - - template struct HashTraits > : SimpleClassHashTraits > { }; - - template struct PtrHash > : PtrHash::PtrType> { - using PtrHash::PtrType>::hash; - static unsigned hash(const RetainPtr

& key) { return hash(key.get()); } - using PtrHash::PtrType>::equal; - static bool equal(const RetainPtr

& a, const RetainPtr

& b) { return a == b; } - static bool equal(typename RetainPtr

::PtrType a, const RetainPtr

& b) { return a == b; } - static bool equal(const RetainPtr

& a, typename RetainPtr

::PtrType b) { return a == b; } - }; - - template struct DefaultHash > { typedef PtrHash > Hash; }; -} // namespace WTF - -using WTF::AdoptCF; -using WTF::AdoptNS; -using WTF::adoptCF; -using WTF::adoptNS; -using WTF::RetainPtr; -using WTF::retainPtr; - -#endif // WTF_RetainPtr_h diff --git a/engine/wtf/TypeTraits.cpp b/engine/wtf/TypeTraits.cpp index a5761c49bc4..537b8aa36d1 100644 --- a/engine/wtf/TypeTraits.cpp +++ b/engine/wtf/TypeTraits.cpp @@ -38,9 +38,7 @@ COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_long_true); COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_unsigned_long_true); COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_long_long_true); COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_unsigned_long_long_true); -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_wchar_t_true); -#endif COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_char_pointer_false); COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_const_char_pointer_false); COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_volatile_char_pointer_false); @@ -64,9 +62,7 @@ COMPILE_ASSERT(IsPod::value, WTF_IsPod_long_true); COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_long_true); COMPILE_ASSERT(IsPod::value, WTF_IsPod_long_long_true); COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_long_long_true); -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) COMPILE_ASSERT(IsPod::value, WTF_IsPod_wchar_t_true); -#endif COMPILE_ASSERT(IsPod::value, WTF_IsPod_char_pointer_true); COMPILE_ASSERT(IsPod::value, WTF_IsPod_const_char_pointer_true); COMPILE_ASSERT(IsPod::value, WTF_IsPod_volatile_char_pointer_true); @@ -89,9 +85,7 @@ COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_l COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_unsigned_long_true); COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_long_long_true); COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_unsigned_long_long_true); -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_wchar_t_true); -#endif COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_double_true); COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_long_double_true); COMPILE_ASSERT(IsConvertibleToInteger::value, WTF_IsConvertibleToInteger_float_true); diff --git a/engine/wtf/TypeTraits.h b/engine/wtf/TypeTraits.h index 3637304b468..c3534a44935 100644 --- a/engine/wtf/TypeTraits.h +++ b/engine/wtf/TypeTraits.h @@ -61,9 +61,7 @@ namespace WTF { template<> struct IsInteger { static const bool value = true; }; template<> struct IsInteger { static const bool value = true; }; template<> struct IsInteger { static const bool value = true; }; -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) template<> struct IsInteger { static const bool value = true; }; -#endif template struct IsFloatingPoint { static const bool value = false; }; template<> struct IsFloatingPoint { static const bool value = true; }; @@ -314,12 +312,8 @@ class NeedsTracing { typedef struct NoType { char padding[8]; } NoType; -#if COMPILER(MSVC) - template static YesType checkHasTraceMethod(char[&V::trace != 0]); -#else template struct HasMethod; template static YesType checkHasTraceMethod(HasMethod*); -#endif // COMPILER(MSVC) template static NoType checkHasTraceMethod(...); public: // We add sizeof(T) to both sides here, because we want it to fail for diff --git a/engine/wtf/Vector.h b/engine/wtf/Vector.h index 4e5f263dd7f..0912c2cebc7 100644 --- a/engine/wtf/Vector.h +++ b/engine/wtf/Vector.h @@ -613,10 +613,8 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE; template Vector& operator=(const Vector&); -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) Vector(Vector&&); Vector& operator=(Vector&&); -#endif size_t size() const { return m_size; } size_t capacity() const { return Base::capacity(); } @@ -796,7 +794,6 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE; return *this; } -#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) template Vector::Vector(Vector&& other) { @@ -812,7 +809,6 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE; swap(other); return *this; } -#endif template template diff --git a/engine/wtf/WTFExport.h b/engine/wtf/WTFExport.h index 3fbe52d447b..06f4abc434a 100644 --- a/engine/wtf/WTFExport.h +++ b/engine/wtf/WTFExport.h @@ -37,15 +37,7 @@ #endif #if defined(COMPONENT_BUILD) -#if defined(WIN32) -#if WTF_IMPLEMENTATION -#define WTF_EXPORT __declspec(dllexport) -#else -#define WTF_EXPORT __declspec(dllimport) -#endif -#else // defined(WIN32) #define WTF_EXPORT __attribute__((visibility("default"))) -#endif #else // defined(COMPONENT_BUILD) #define WTF_EXPORT #endif diff --git a/engine/wtf/dtoa.cpp b/engine/wtf/dtoa.cpp index a55bd14bd53..1c1195562c6 100644 --- a/engine/wtf/dtoa.cpp +++ b/engine/wtf/dtoa.cpp @@ -40,12 +40,6 @@ #include "wtf/ThreadingPrimitives.h" #include "wtf/Vector.h" -#if COMPILER(MSVC) -#pragma warning(disable: 4244) -#pragma warning(disable: 4245) -#pragma warning(disable: 4554) -#endif - namespace WTF { Mutex* s_dtoaP5Mutex; diff --git a/engine/wtf/dtoa/utils.h b/engine/wtf/dtoa/utils.h index 54bbfb30fb4..ac7b85cc7b2 100644 --- a/engine/wtf/dtoa/utils.h +++ b/engine/wtf/dtoa/utils.h @@ -49,35 +49,13 @@ defined(__ARMEL__) || defined(__aarch64__) || \ defined(__MIPSEL__) #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 #elif defined(_M_IX86) || defined(__i386__) -#if defined(_WIN32) -// Windows uses a 64bit wide floating point stack. -#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 -#else #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS -#endif // _WIN32 #else #error Target architecture was not detected as supported by Double-Conversion. #endif - -#if defined(_WIN32) && !defined(__MINGW32__) - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; // NOLINT -typedef unsigned short uint16_t; // NOLINT -typedef int int32_t; -typedef unsigned int uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -// intptr_t and friends are defined in crtdefs.h through stdio.h. - -#else - #include -#endif - // The following macro works on both 32 and 64-bit platforms. // Usage: instead of writing 0x1234567890123456 // write UINT64_2PART_C(0x12345678,90123456); diff --git a/engine/wtf/testing/WTFUnitTestHelpersExport.h b/engine/wtf/testing/WTFUnitTestHelpersExport.h index ea0a77c4524..a37ce52e777 100644 --- a/engine/wtf/testing/WTFUnitTestHelpersExport.h +++ b/engine/wtf/testing/WTFUnitTestHelpersExport.h @@ -37,15 +37,7 @@ #endif #if defined(COMPONENT_BUILD) -#if defined(WIN32) -#if WTF_UNITTEST_HELPERS_IMPLEMENTATION -#define WTF_UNITTEST_HELPERS_EXPORT __declspec(dllexport) -#else -#define WTF_UNITTEST_HELPERS_EXPORT __declspec(dllimport) -#endif -#else // defined(WIN32) #define WTF_UNITTEST_HELPERS_EXPORT __attribute__((visibility("default"))) -#endif #else // defined(COMPONENT_BUILD) #define WTF_UNITTEST_HELPERS_EXPORT #endif diff --git a/engine/wtf/text/StringImpl.h b/engine/wtf/text/StringImpl.h index 2c35a294136..6367f0c8f3b 100644 --- a/engine/wtf/text/StringImpl.h +++ b/engine/wtf/text/StringImpl.h @@ -32,14 +32,6 @@ #include "wtf/WTFExport.h" #include "wtf/unicode/Unicode.h" -#if USE(CF) -typedef const struct __CFString * CFStringRef; -#endif - -#ifdef __OBJC__ -@class NSString; -#endif - namespace WTF { struct AlreadyHashed; @@ -50,7 +42,6 @@ struct LCharBufferTranslator; struct CharBufferFromLiteralDataTranslator; struct SubstringTranslator; struct UCharBufferTranslator; -template class RetainPtr; enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; @@ -399,13 +390,6 @@ public: PassRefPtr replace(unsigned index, unsigned len, StringImpl*); PassRefPtr upconvertedString(); -#if USE(CF) - RetainPtr createCFString(); -#endif -#ifdef __OBJC__ - operator NSString*(); -#endif - #ifdef STRING_STATS ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } #endif diff --git a/engine/wtf/text/StringOperatorsTest.cpp b/engine/wtf/text/StringOperatorsTest.cpp index e27c82e6525..73af2791dd4 100644 --- a/engine/wtf/text/StringOperatorsTest.cpp +++ b/engine/wtf/text/StringOperatorsTest.cpp @@ -148,41 +148,6 @@ TEST(WTF, DISABLED_StringOperators) EXPECT_N_WTF_STRING_COPIES(2, atomicString + literal + string + literal); EXPECT_N_WTF_STRING_COPIES(2, atomicString + (literal + string + literal)); EXPECT_N_WTF_STRING_COPIES(2, (atomicString + literal) + (string + literal)); - -#if COMPILER(MSVC) - EXPECT_N_WTF_STRING_COPIES(1, L"wide string" + string); - EXPECT_N_WTF_STRING_COPIES(1, string + L"wide string"); - EXPECT_N_WTF_STRING_COPIES(1, L"wide string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(1, atomicString + L"wide string"); - - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + string + L"wide string" + string); - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (string + L"wide string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + string) + (L"wide string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, string + L"wide string" + string + L"wide string"); - EXPECT_N_WTF_STRING_COPIES(2, string + (L"wide string" + string + L"wide string")); - EXPECT_N_WTF_STRING_COPIES(2, (string + L"wide string") + (string + L"wide string")); - - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + atomicString + L"wide string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (atomicString + L"wide string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + atomicString) + (L"wide string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + L"wide string" + atomicString + L"wide string"); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + (L"wide string" + atomicString + L"wide string")); - EXPECT_N_WTF_STRING_COPIES(2, (atomicString + L"wide string") + (atomicString + L"wide string")); - - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + string + L"wide string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (string + L"wide string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + string) + (L"wide string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, string + L"wide string" + atomicString + L"wide string"); - EXPECT_N_WTF_STRING_COPIES(2, string + (L"wide string" + atomicString + L"wide string")); - EXPECT_N_WTF_STRING_COPIES(2, (string + L"wide string") + (atomicString + L"wide string")); - - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + atomicString + L"wide string" + string); - EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (atomicString + L"wide string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + atomicString) + (L"wide string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + L"wide string" + string + L"wide string"); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + (L"wide string" + string + L"wide string")); - EXPECT_N_WTF_STRING_COPIES(2, (atomicString + L"wide string") + (string + L"wide string")); -#endif } } // namespace diff --git a/engine/wtf/text/WTFString.cpp b/engine/wtf/text/WTFString.cpp index e23f7286a6f..dfffa6a21ff 100644 --- a/engine/wtf/text/WTFString.cpp +++ b/engine/wtf/text/WTFString.cpp @@ -469,9 +469,6 @@ String String::format(const char *format, ...) Vector buffer; // Do the format once to get the length. -#if COMPILER(MSVC) - int result = _vscprintf(format, args); -#else char ch; int result = vsnprintf(&ch, 1, format, args); // We need to call va_end() and then va_start() again here, as the @@ -482,7 +479,6 @@ String String::format(const char *format, ...) // systems, but fails e.g. on 64bit Linux. va_end(args); va_start(args, format); -#endif if (result == 0) return String(""); @@ -1015,18 +1011,9 @@ static inline IntegralType toIntegralType(const CharType* data, size_t length, b ++data; } -#if COMPILER(MSVC) -#pragma warning(push, 0) -#pragma warning(disable:4146) -#endif - if (isNegative) value = -value; -#if COMPILER(MSVC) -#pragma warning(pop) -#endif - // skip trailing space while (length && isSpaceOrNewline(*data)) { --length; diff --git a/viewer/cc/sky_viewer_cc_export.h b/viewer/cc/sky_viewer_cc_export.h index bf2a1380372..6719cbd6504 100644 --- a/viewer/cc/sky_viewer_cc_export.h +++ b/viewer/cc/sky_viewer_cc_export.h @@ -6,21 +6,12 @@ #define SKY_VIEWER_CC_SKY_VIEWER_CC_EXPORT_H_ #if defined(COMPONENT_BUILD) -#if defined(WIN32) -#if defined(SKY_VIEWER_CC_IMPLEMENTATION) -#define SKY_VIEWER_CC_EXPORT __declspec(dllexport) -#else -#define SKY_VIEWER_CC_EXPORT __declspec(dllimport) -#endif // defined(SKY_VIEWER_CC_IMPLEMENTATION) - -#else // defined(WIN32) #if defined(SKY_VIEWER_CC_IMPLEMENTATION) #define SKY_VIEWER_CC_EXPORT __attribute__((visibility("default"))) #else #define SKY_VIEWER_CC_EXPORT #endif -#endif #else // defined(COMPONENT_BUILD) #define SKY_VIEWER_CC_EXPORT