Skip to content

Commit

Permalink
Revert VS2013 workaround
Browse files Browse the repository at this point in the history
Introduced in sass#2308, no longer
necessary with VS2015.
  • Loading branch information
glebm committed Nov 23, 2018
1 parent edd0014 commit 83e2b1b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@

#include <cmath>
#include <stdint.h>
#if defined(_MSC_VER) && _MSC_VER >= 1800 && _MSC_VER < 1900 && defined(_M_X64)
#include <mutex>
#endif

namespace Sass {

double round(double val, size_t precision)
{
// Disable FMA3-optimized implementation when compiling with VS2013 for x64 targets
// See https://github.com/sass/node-sass/issues/1854 for details
// FIXME: Remove this workaround when we switch to VS2015+
#if defined(_MSC_VER) && _MSC_VER >= 1800 && _MSC_VER < 1900 && defined(_M_X64)
static std::once_flag flag;
std::call_once(flag, []() { _set_FMA3_enable(0); });
#endif

// https://github.com/sass/sass/commit/4e3e1d5684cc29073a507578fc977434ff488c93
if (fmod(val, 1) - 0.5 > - std::pow(0.1, precision + 1)) return std::ceil(val);
else if (fmod(val, 1) - 0.5 > std::pow(0.1, precision)) return std::floor(val);
Expand Down

0 comments on commit 83e2b1b

Please sign in to comment.