Commit 5c227efc authored by peastman's avatar peastman
Browse files

Merge pull request #239 from peastman/master

Fixes for compilation errors on Visual Studio 2013
parents 56e5e007 b4150b1b
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <sstream> #include <sstream>
#include <algorithm>
namespace Lepton { namespace Lepton {
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
#define LEPTON_MSVC_ERFC_H_ #define LEPTON_MSVC_ERFC_H_
/* /*
* At least up to version 8 (VC++ 2005), Microsoft does not support the * Up to version 11 (VC++ 2012), Microsoft does not support the
* standard C99 erf() and erfc() functions. For now we're including these * standard C99 erf() and erfc() functions so we have to fake them here.
* definitions for an MSVC compilation; if these are added later then * These were added in version 12 (VC++ 2013), which sets _MSC_VER=1800
* the #ifdef below should change to compare _MSC_VER with a particular * (VC11 has _MSC_VER=1700).
* version level.
*/ */
#ifdef _MSC_VER #if defined(_MSC_VER)
#define M_PI 3.14159265358979323846264338327950288
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
/*************************** /***************************
* erf.cpp * erf.cpp
* author: Steve Strand * author: Steve Strand
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#include <cmath> #include <cmath>
#define M_PI 3.14159265358979323846264338327950288
static const double rel_error= 1E-12; //calculate 12 significant figures static const double rel_error= 1E-12; //calculate 12 significant figures
//you can adjust rel_error to trade off between accuracy and speed //you can adjust rel_error to trade off between accuracy and speed
//but don't ask for > 15 figures (assuming usual 52 bit mantissa in a double) //but don't ask for > 15 figures (assuming usual 52 bit mantissa in a double)
...@@ -83,6 +81,7 @@ static double erfc(double x) ...@@ -83,6 +81,7 @@ static double erfc(double x)
return one_sqrtpi*exp(-x*x)*q2; return one_sqrtpi*exp(-x*x)*q2;
} }
#endif // _MSC_VER <= 1700
#endif // _MSC_VER #endif // _MSC_VER
#endif // LEPTON_MSVC_ERFC_H_ #endif // LEPTON_MSVC_ERFC_H_
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
#define OPENMM_MSVC_ERFC_H_ #define OPENMM_MSVC_ERFC_H_
/* /*
* At least up to version 8 (VC++ 2005), Microsoft does not support the * Up to version 11 (VC++ 2012), Microsoft does not support the
* standard C99 erf() and erfc() functions. For now we're including these * standard C99 erf() and erfc() functions so we have to fake them here.
* definitions for an MSVC compilation; if these are added later then * These were added in version 12 (VC++ 2013), which sets _MSC_VER=1800
* the #ifdef below should change to compare _MSC_VER with a particular * (VC11 has _MSC_VER=1700).
* version level.
*/ */
#ifdef _MSC_VER #if defined(_MSC_VER)
#define M_PI 3.14159265358979323846264338327950288
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
/*************************** /***************************
* erf.cpp * erf.cpp
* author: Steve Strand * author: Steve Strand
...@@ -81,6 +81,7 @@ static double erfc(double x) ...@@ -81,6 +81,7 @@ static double erfc(double x)
return one_sqrtpi*exp(-x*x)*q2; return one_sqrtpi*exp(-x*x)*q2;
} }
#endif // _MSC_VER <= 1700
#endif // _MSC_VER #endif // _MSC_VER
#endif // OPENMM_MSVC_ERFC_H_ #endif // OPENMM_MSVC_ERFC_H_
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