added compile time assertion for _SECURE_SCL=0. It is very important that all libraries are compiled with the same _SECURE_SCL if you want to share STL functions between libraries.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@876 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc
2008-10-15 12:40:31 +00:00
parent 2abedd28fe
commit 8e3bd6781e
12 changed files with 230 additions and 227 deletions

View File

@ -254,4 +254,24 @@ void Host_UpdateLogDisplay();
#define _assert_(a)
#define _assert_msg_(...)
#endif
// compile time asserts
namespace
{
// it is very risky to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries
// it is possible that you overwrite memory if you do it
#ifndef _SECURE_SCL
#error Please define _SECURE_SCL=0 in the project settings
#else
template <bool> struct CompileTimeAssert;
template<> struct CompileTimeAssert<true> {};
CompileTimeAssert<_SECURE_SCL==0> x;
#endif
}
#endif // #ifndef _COMMON_H