Warn at link time against mixing components built with incompatible settings.

Supported for MSVC 2010 and newer, see
http://msdn.microsoft.com/en-us/library/ee956429.aspx
metadata
Edgar Velazquez-Armendariz 2014-02-16 15:29:27 -05:00
parent 5c9031cfb6
commit 25aec52f78
1 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,17 @@
#include <math.h>
#pragma intrinsic(memset, memcmp, memcpy, strlen, strcmp, strcpy, _strset, strcat, fabs, abs)
#endif
#if _MSC_VER >= 1600
#ifdef SINGLE_PRECISION
#pragma detect_mismatch( "MTS_FLOAT_PRECISION", "SINGLE")
#elif DOUBLE_PRECISION
#pragma detect_mismatch( "MTS_FLOAT_PRECISION", "DOUBLE")
#endif
#define MTS_STRINGIFY(s) #s
#define MTS_XSTRINGIFY(s) MTS_STRINGIFY(s)
#pragma detect_mismatch("MTS_SPECTRUM_SAMPLES", MTS_XSTRINGIFY(SPECTRUM_SAMPLES))
#endif
#elif defined(__APPLE__)
#define __OSX__
#elif defined(__linux)