Merge pull request #956 from adishavit/master

Fixes a few build issues with MSVC 2015 and gcc
pull/964/head
Kim Kulling 2016-07-26 00:16:16 +02:00 committed by GitHub
commit 86e2876083
2 changed files with 6 additions and 6 deletions

View File

@ -56,11 +56,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//using namespace Assimp;
namespace Assimp {
// make sure typeof returns consistent output across different platforms
// make sure type_of returns consistent output across different platforms
// also consider using: typeid(VAR).name()
template <typename T> const char* typeof(T&) { return "unknown"; }
template<> const char* typeof(float&) { return "float"; }
template<> const char* typeof(double&) { return "double"; }
template <typename T> const char* type_of(T&) { return "unknown"; }
template<> const char* type_of(float&) { return "float"; }
template<> const char* type_of(double&) { return "double"; }
// ------------------------------------------------------------------------------------------------
// Worker function for exporting a scene to PLY. Prototyped and registered in Exporter.cpp
@ -146,7 +146,7 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina
// definitely not good to always write float even if we might have double precision
ai_real tmp = 0.0;
const char * typeName = typeof(tmp);
const char * typeName = type_of(tmp);
mOutput << "element vertex " << vertices << endl;
mOutput << "property " << typeName << " x" << endl;

View File

@ -216,7 +216,7 @@ struct aiColor3D
/** Check whether a color is black */
bool IsBlack() const {
static const ai_real epsilon = 10e-3;
static const ai_real epsilon = ai_real(10e-3);
return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;
}