Remove version checks for _MSC_VER < 1800 (msvs2013).

We already actively do not support older versions of the vc++
compiler and runtime, so don't check for them anymore.

TBR=reed
No API changes.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1777213003

Review URL: https://codereview.chromium.org/1777213003
This commit is contained in:
bungeman 2016-03-10 11:14:40 -08:00 committed by Commit bot
parent cf371bb41b
commit d7dc76f7e9
14 changed files with 18 additions and 86 deletions

View File

@ -72,7 +72,7 @@ int32_t SkSqrtBits(int32_t value, int bitBias);
int SkCLZ_portable(uint32_t);
#ifndef SkCLZ
#if defined(_MSC_VER) && _MSC_VER >= 1400
#if defined(_MSC_VER)
#include <intrin.h>
static inline int SkCLZ(uint32_t mask) {

View File

@ -106,7 +106,7 @@ typedef unsigned __int64 uint64_t;
* particular compiler.
* To insert compiler warnings use "#pragma message GR_WARN(<string>)"
*/
#if defined(_MSC_VER) && _MSC_VER
#if defined(_MSC_VER)
#define GR_WARN(MSG) (GR_FILE_AND_LINE_STR "WARNING: " MSG)
#else//__GNUC__ - may need other defines for different compilers
#define GR_WARN(MSG) ("WARNING: " MSG)
@ -171,19 +171,7 @@ typedef unsigned __int64 uint64_t;
* it may print the message in the compiler log. Obviously, the condition must
* be evaluatable at compile time.
*/
// VS 2010 and GCC compiled with c++0x or gnu++0x support the new
// static_assert.
#if !defined(GR_STATIC_ASSERT)
#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)
#define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")
#else
template <bool> class GR_STATIC_ASSERT_FAILURE;
template <> class GR_STATIC_ASSERT_FAILURE<true> {};
#define GR_STATIC_ASSERT(CONDITION) \
enum {GR_CONCAT(X,__LINE__) = \
sizeof(GR_STATIC_ASSERT_FAILURE<CONDITION>)}
#endif
#endif
#define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")
/**
* Set to 1 to enable pixel local storage path rendering on supported devices.

View File

@ -29,33 +29,6 @@ static inline float sk_float_pow(float base, float exp) {
return powf(base, exp);
}
static inline float sk_float_copysign(float x, float y) {
// c++11 contains a 'float copysign(float, float)' function in <cmath>.
// clang-cl reports __cplusplus for clang, not the __cplusplus vc++ version _MSC_VER would report.
#if (defined(_MSC_VER) && defined(__clang__))
# define SK_BUILD_WITH_CLANG_CL 1
#else
# define SK_BUILD_WITH_CLANG_CL 0
#endif
#if (!SK_BUILD_WITH_CLANG_CL && __cplusplus >= 201103L) || (_MSC_VER >= 1800)
return copysignf(x, y);
// Posix has demanded 'float copysignf(float, float)' (from C99) since Issue 6.
#elif defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
return copysignf(x, y);
// Visual studio prior to 13 only has 'double _copysign(double, double)'.
#elif defined(_MSC_VER)
return (float)_copysign(x, y);
// Otherwise convert to bits and extract sign.
#else
int32_t xbits = SkFloat2Bits(x);
int32_t ybits = SkFloat2Bits(y);
return SkBits2Float((xbits & 0x7FFFFFFF) | (ybits & 0x80000000));
#endif
}
#define sk_float_sqrt(x) sqrtf(x)
#define sk_float_sin(x) sinf(x)
#define sk_float_cos(x) cosf(x)
@ -71,6 +44,7 @@ static inline float sk_float_copysign(float x, float y) {
#endif
#define sk_float_atan2(y,x) atan2f(y,x)
#define sk_float_abs(x) fabsf(x)
#define sk_float_copysign(x, y) copysignf(x, y)
#define sk_float_mod(x,y) fmodf(x,y)
#define sk_float_exp(x) expf(x)
#define sk_float_log(x) logf(x)

View File

@ -730,7 +730,7 @@ void SkDisplayType::UnitTest() {
SkDisplayable* test = CreateInstance(maker, gTypeNames[index].fType);
if (test == nullptr)
continue;
#if defined _WIN32 && _MSC_VER >= 1300 && defined _INC_CRTDBG // only on windows, only if using "crtdbg.h"
#if defined _WIN32 && defined _INC_CRTDBG // only on windows, only if using "crtdbg.h"
// we know that crtdbg puts 0xfdfdfdfd at the end of the block
// look for unitialized memory, signature 0xcdcdcdcd prior to that
int* start = (int*) test;

View File

@ -52,7 +52,7 @@ static SkScalar RGB_to_HSV(SkColor color, HSV_Choice choice) {
return hue;
}
#if defined _WIN32 && _MSC_VER >= 1300 // disable 'red', etc. may be used without having been initialized
#if defined _WIN32 // disable 'red', etc. may be used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -89,7 +89,7 @@ static SkColor HSV_to_RGB(SkColor color, HSV_Choice choice, SkScalar hsv) {
SkScalarRoundToInt(green), SkScalarRoundToInt(blue));
}
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif

View File

@ -171,22 +171,12 @@ static inline U16CPU fixed_repeat(SkFixed x) {
return x & 0xFFFF;
}
// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
// See http://code.google.com/p/skia/issues/detail?id=472
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", off)
#endif
static inline U16CPU fixed_mirror(SkFixed x) {
SkFixed s = SkLeftShift(x, 15) >> 31;
// s is FFFFFFFF if we're on an odd interval, or 0 if an even interval
return (x ^ s) & 0xFFFF;
}
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", on)
#endif
static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) {
if (SkShader::kClamp_TileMode == m) {
return fixed_clamp;

View File

@ -62,7 +62,7 @@ const SkPixmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) {
return nullptr;
}
#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -252,7 +252,7 @@ void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) {
}
}
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif

View File

@ -1435,7 +1435,7 @@ void SkDraw::drawText_asPaths(const char text[], size_t byteLength,
}
// disable warning : local variable used without having been initialized
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -1671,7 +1671,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
offset, *fMatrix, pos, scalarsPerPosition, textAlignment, cache.get(), drawOneGlyph);
}
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif

View File

@ -599,7 +599,7 @@ bool SkRegion::setRects(const SkIRect rects[], int count) {
///////////////////////////////////////////////////////////////////////////////
#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -737,7 +737,7 @@ static SkRegion::RunType* operate_on_span(const SkRegion::RunType a_runs[],
return dst;
}
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif

View File

@ -119,7 +119,7 @@ static void validate_edges_for_y(const SkEdge* edge, int curr_y) {
#define validate_edges_for_y(edge, curr_y)
#endif
#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -392,7 +392,7 @@ static void PrePostInverseBlitterProc(SkBlitter* blitter, int y, bool isStart) {
///////////////////////////////////////////////////////////////////////////////
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif

View File

@ -51,21 +51,11 @@ static inline SkFixed repeat_tileproc(SkFixed x) {
// Mirror
// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
// See http://code.google.com/p/skia/issues/detail?id=472
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", off)
#endif
static inline SkFixed mirror_tileproc(SkFixed x) {
int s = SkLeftShift(x, 15) >> 31;
return (x ^ s) & 0xFFFF;
}
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", on)
#endif
///////////////////////////////////////////////////////////////////////////////
typedef SkFixed (*TileProc)(SkFixed);

View File

@ -17,12 +17,6 @@ static inline int repeat_8bits(int x) {
return x & 0xFF;
}
// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
// See http://code.google.com/p/skia/issues/detail?id=472
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", off)
#endif
static inline int mirror_8bits(int x) {
if (x & 256) {
x = ~x;
@ -30,10 +24,6 @@ static inline int mirror_8bits(int x) {
return x & 255;
}
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", on)
#endif
static SkMatrix pts_to_unit_matrix(const SkPoint pts[2]) {
SkVector vec = pts[1] - pts[0];
SkScalar mag = vec.length();

View File

@ -19,7 +19,7 @@
#endif
//Detect if typed enums are supported.
#if defined(_MSC_VER) && _MSC_VER >= 1400
#if defined(_MSC_VER)
#define SK_TYPED_ENUMS
#elif defined(__clang__) && __has_extension(cxx_strong_enums)

View File

@ -29,7 +29,7 @@ static const signed char decodeData[] = {
SkBase64::SkBase64() : fLength((size_t) -1), fData(nullptr) {
}
#if defined _WIN32 && _MSC_VER >= 1300 // disable 'two', etc. may be used without having been initialized
#if defined _WIN32 // disable 'two', etc. may be used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@ -105,7 +105,7 @@ goHome:
return kNoError;
}
#if defined _WIN32 && _MSC_VER >= 1300
#if defined _WIN32
#pragma warning ( pop )
#endif