Yet another small improvements to library initialization code.
This commit is contained in:
parent
afa83d8645
commit
9a898f5d49
@ -41,10 +41,6 @@ template<typename K, typename V> class QHash;
|
|||||||
//Interface version
|
//Interface version
|
||||||
#define MUTILS_INTERFACE 2
|
#define MUTILS_INTERFACE 2
|
||||||
|
|
||||||
//Build key
|
|
||||||
#define MUTILS_BUILD_KEY_HELPER(X,Y) X##" "##Y
|
|
||||||
#define MUTILS_BUILD_KEY MUTILS_BUILD_KEY_HELPER(__DATE__, __TIME__)
|
|
||||||
|
|
||||||
//MUtils API
|
//MUtils API
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# ifdef MUTILS_DLL_EXPORT
|
# ifdef MUTILS_DLL_EXPORT
|
||||||
@ -370,8 +366,8 @@ namespace MUtils
|
|||||||
//Internal (do *not* call directly!)
|
//Internal (do *not* call directly!)
|
||||||
namespace Internal
|
namespace Internal
|
||||||
{
|
{
|
||||||
MUTILS_API int MUTILS_INITIALIZER(const unsigned int interfaceId, const bool debugFlag, const char *const buildKey);
|
MUTILS_API unsigned int MUTILS_INITIALIZER(const unsigned int interfaceId);
|
||||||
static const int s_initializedFlag = MUTILS_INITIALIZER(MUTILS_INTERFACE, MUTILS_DEBUG, MUTILS_BUILD_KEY);
|
static const unsigned int init_flag = MUTILS_INITIALIZER(MUTILS_INTERFACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,16 +905,14 @@ MUtils::fp_parts_t MUtils::break_fp(const double value)
|
|||||||
// INITIALIZER
|
// INITIALIZER
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int MUtils::Internal::MUTILS_INITIALIZER(const unsigned int interfaceId, const bool debugFlag, const char *const buildKey)
|
unsigned int MUtils::Internal::MUTILS_INITIALIZER(const unsigned int interfaceId)
|
||||||
{
|
{
|
||||||
#if (!MUTILS_DEBUG)
|
if(interfaceId != ((unsigned int)MUTILS_INTERFACE))
|
||||||
if((interfaceId != static_cast<unsigned int>(MUTILS_INTERFACE)) || (debugFlag != static_cast<bool>(MUTILS_DEBUG)) || strncmp(buildKey, MUTILS_BUILD_KEY, 14))
|
|
||||||
{
|
{
|
||||||
OS::system_message_err(L"MUtils", L"ERROR: MUtils library initialization has failed!");
|
OS::system_message_err(L"MUtils", L"ERROR: MUtils library initialization has failed!");
|
||||||
for(;;) _exit((int)0xC0000142);
|
for(;;) _exit((int)0xC0000142);
|
||||||
}
|
}
|
||||||
#endif //MUTILS_DEBUG
|
|
||||||
|
|
||||||
volatile int _result = MUTILS_INTERFACE;
|
volatile unsigned int _result = MUTILS_INTERFACE;
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user