diff --git a/docs/d2/dad/_hash_8h_source.html b/docs/d2/dad/_hash_8h_source.html
index c766025..e2b95ce 100644
--- a/docs/d2/dad/_hash_8h_source.html
+++ b/docs/d2/dad/_hash_8h_source.html
@@ -73,7 +73,7 @@ $(function() {
static const quint16 HASH_BLAKE2_512
Hash algorithm identifier.
Definition: Hash.h:42
static const quint16 HASH_KECCAK_384
Hash algorithm identifier.
Definition: Hash.h:45
Global MUtils namespace.
Definition: CPUFeatures.h:37
-#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:405
+#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:416
MUTILS_API Hash * create(const quint16 &hashId, const char *const key=NULL)
Create instance of a hash function.
This abstract class specifies the generic interface for all support hash algorithms.
Definition: Hash.h:57
static const quint16 HASH_KECCAK_256
Hash algorithm identifier.
Definition: Hash.h:44
diff --git a/docs/d2/df4/namespace_m_utils_1_1_o_s.html b/docs/d2/df4/namespace_m_utils_1_1_o_s.html
index 53ff670..b70822d 100644
--- a/docs/d2/df4/namespace_m_utils_1_1_o_s.html
+++ b/docs/d2/df4/namespace_m_utils_1_1_o_s.html
@@ -249,12 +249,12 @@ MUTILS_API void shell_chan
MUTILS_API QString | get_file_path (const int &fd) |
|
-
-MUTILS_API bool | wow64fsredir_disable (void *oldValue) |
- |
-
-MUTILS_API bool | wow64fsredir_revert (void *oldValue) |
- |
+
+MUTILS_API bool | wow64fsredir_disable (uintptr_t &oldValue) |
+ |
+
+MUTILS_API bool | wow64fsredir_revert (const uintptr_t oldValue) |
+ |
MUTILS_API QString | get_envvar (const QString &name) |
|
diff --git a/docs/d3/dc1/_o_s_support_8h.html b/docs/d3/dc1/_o_s_support_8h.html
index cc75f9b..11e9f18 100644
--- a/docs/d3/dc1/_o_s_support_8h.html
+++ b/docs/d3/dc1/_o_s_support_8h.html
@@ -279,12 +279,12 @@ MUTILS_API void | MUtils::OS
MUTILS_API QString | MUtils::OS::get_file_path (const int &fd) |
|
-
-MUTILS_API bool | MUtils::OS::wow64fsredir_disable (void *oldValue) |
- |
-
-MUTILS_API bool | MUtils::OS::wow64fsredir_revert (void *oldValue) |
- |
+
+MUTILS_API bool | MUtils::OS::wow64fsredir_disable (uintptr_t &oldValue) |
+ |
+
+MUTILS_API bool | MUtils::OS::wow64fsredir_revert (const uintptr_t oldValue) |
+ |
MUTILS_API QString | MUtils::OS::get_envvar (const QString &name) |
|
diff --git a/docs/d3/dc1/_o_s_support_8h_source.html b/docs/d3/dc1/_o_s_support_8h_source.html
index ad12ac0..1f91198 100644
--- a/docs/d3/dc1/_o_s_support_8h_source.html
+++ b/docs/d3/dc1/_o_s_support_8h_source.html
@@ -67,7 +67,7 @@ $(function() {
OSSupport.h
- Go to the documentation of this file. 143 MUTILS_API void system_message_nfo( const wchar_t * const title, const wchar_t * const text); 144 MUTILS_API void system_message_wrn( const wchar_t * const title, const wchar_t * const text); 145 MUTILS_API void system_message_err( const wchar_t * const title, const wchar_t * const text); 148 typedef QMap<QString,QString> ArgumentMap; 149 MUTILS_API const QStringList crack_command_line( const QString &command_line = QString()); 150 MUTILS_API const ArgumentMap &arguments( void); 153 typedef bool (*progress_callback_t)( const double &progress, void * const userData); 154 MUTILS_API bool copy_file( const QString &sourcePath, const QString &outputPath, const bool &overwrite = true, const progress_callback_t callback = NULL, void * const userData = NULL); 157 MUTILS_API bool get_file_version( const QString fileName, quint16 * const major = NULL, quint16 * const minor = NULL, quint16 * const patch = NULL, quint16 * const build = NULL); 162 MUTILS_API const bool &running_on_wine( void); 168 MUTILS_API QDate current_date( void); 169 MUTILS_API quint64 current_file_time( void); 172 MUTILS_API bool is_elevated( bool *bIsUacEnabled = NULL); 173 MUTILS_API bool user_is_admin( void); 185 MUTILS_API bool handle_os_message( const void * const message, long *result); 196 MUTILS_API void sleep_ms( const size_t &duration); 199 MUTILS_API bool is_executable_file( const QString &path); 200 MUTILS_API bool is_library_file( const QString &path); 203 MUTILS_API bool is_hibernation_supported( void); 204 MUTILS_API bool shutdown_computer( const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate); 207 MUTILS_API bool free_diskspace( const QString &path, quint64 &freeSpace); 223 MUTILS_API bool shell_open( const QWidget *parent, const QString &url, const bool explore = false); 224 MUTILS_API bool shell_open( const QWidget *parent, const QString &url, const QString ¶meters, const QString &directory, const bool explore = false); 227 MUTILS_API bool open_media_file( const QString &mediaFilePath); 230 MUTILS_API bool change_process_priority( const int priority); 231 MUTILS_API bool change_process_priority( const QProcess *proc, const int priority); 234 MUTILS_API quint32 process_id( void); 235 MUTILS_API quint32 process_id( const QProcess * const proc); 238 MUTILS_API quint32 thread_id( void); 239 MUTILS_API quint32 thread_id( const QProcess * const proc); 242 MUTILS_API bool suspend_process( const QProcess *proc, const bool suspend); 245 MUTILS_API bool setup_timer_resolution( const quint32 &interval = 1); 246 MUTILS_API bool reset_timer_resolution( const quint32 &interval = 1); 249 MUTILS_API bool set_file_time( const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime()); 250 MUTILS_API bool set_file_time( const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime()); 253 MUTILS_API bool check_key_state_esc( void); 256 MUTILS_API void shell_change_notification( void); 259 MUTILS_API QString get_file_path( const int &fd); 262 MUTILS_API bool wow64fsredir_disable( void *oldValue); 263 MUTILS_API bool wow64fsredir_revert ( void *oldValue); 266 MUTILS_API QString get_envvar( const QString &name); 267 MUTILS_API bool set_envvar( const QString &name, const QString &value); 270 MUTILS_API const QLatin1String &null_device( void); 273 MUTILS_API void check_debugger( void); 276 MUTILS_API void fatal_exit( const wchar_t* const errorMessage); MUTILS_API int network_status(void) Check the network status.
+ Go to the documentation of this file. 143 MUTILS_API void system_message_nfo( const wchar_t * const title, const wchar_t * const text); 144 MUTILS_API void system_message_wrn( const wchar_t * const title, const wchar_t * const text); 145 MUTILS_API void system_message_err( const wchar_t * const title, const wchar_t * const text); 148 typedef QMap<QString,QString> ArgumentMap; 149 MUTILS_API const QStringList crack_command_line( const QString &command_line = QString()); 150 MUTILS_API const ArgumentMap &arguments( void); 153 typedef bool (*progress_callback_t)( const double &progress, void * const userData); 154 MUTILS_API bool copy_file( const QString &sourcePath, const QString &outputPath, const bool &overwrite = true, const progress_callback_t callback = NULL, void * const userData = NULL); 157 MUTILS_API bool get_file_version( const QString fileName, quint16 * const major = NULL, quint16 * const minor = NULL, quint16 * const patch = NULL, quint16 * const build = NULL); 162 MUTILS_API const bool &running_on_wine( void); 168 MUTILS_API QDate current_date( void); 169 MUTILS_API quint64 current_file_time( void); 172 MUTILS_API bool is_elevated( bool *bIsUacEnabled = NULL); 173 MUTILS_API bool user_is_admin( void); 185 MUTILS_API bool handle_os_message( const void * const message, long *result); 196 MUTILS_API void sleep_ms( const size_t &duration); 199 MUTILS_API bool is_executable_file( const QString &path); 200 MUTILS_API bool is_library_file( const QString &path); 203 MUTILS_API bool is_hibernation_supported( void); 204 MUTILS_API bool shutdown_computer( const QString &message, const unsigned long timeout, const bool forceShutdown, const bool hibernate); 207 MUTILS_API bool free_diskspace( const QString &path, quint64 &freeSpace); 223 MUTILS_API bool shell_open( const QWidget *parent, const QString &url, const bool explore = false); 224 MUTILS_API bool shell_open( const QWidget *parent, const QString &url, const QString ¶meters, const QString &directory, const bool explore = false); 227 MUTILS_API bool open_media_file( const QString &mediaFilePath); 230 MUTILS_API bool change_process_priority( const int priority); 231 MUTILS_API bool change_process_priority( const QProcess *proc, const int priority); 234 MUTILS_API quint32 process_id( void); 235 MUTILS_API quint32 process_id( const QProcess * const proc); 238 MUTILS_API quint32 thread_id( void); 239 MUTILS_API quint32 thread_id( const QProcess * const proc); 242 MUTILS_API bool suspend_process( const QProcess *proc, const bool suspend); 245 MUTILS_API bool setup_timer_resolution( const quint32 &interval = 1); 246 MUTILS_API bool reset_timer_resolution( const quint32 &interval = 1); 249 MUTILS_API bool set_file_time( const QFile &file, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime()); 250 MUTILS_API bool set_file_time( const QString &path, const QDateTime &created = QDateTime(), const QDateTime &modified = QDateTime(), const QDateTime &accessed = QDateTime()); 253 MUTILS_API bool check_key_state_esc( void); 256 MUTILS_API void shell_change_notification( void); 259 MUTILS_API QString get_file_path( const int &fd); 262 MUTILS_API bool wow64fsredir_disable(uintptr_t &oldValue); 263 MUTILS_API bool wow64fsredir_revert ( const uintptr_t oldValue); 266 MUTILS_API QString get_envvar( const QString &name); 267 MUTILS_API bool set_envvar( const QString &name, const QString &value); 270 MUTILS_API const QLatin1String &null_device( void); 273 MUTILS_API void check_debugger( void); 276 MUTILS_API void fatal_exit( const wchar_t* const errorMessage); MUTILS_API int network_status(void) Check the network status.
MUTILS_API const os_version_t UNKNOWN_OPSYS Operating system version constant.
Local application data (non-roaming) Definition: OSSupport.h:109
unsigned int versionMinor The minor version of the underlaying operating system. Definition: OSSupport.h:75
diff --git a/docs/d4/d85/_job_object_8h_source.html b/docs/d4/d85/_job_object_8h_source.html
index a299102..ea186dc 100644
--- a/docs/d4/d85/_job_object_8h_source.html
+++ b/docs/d4/d85/_job_object_8h_source.html
@@ -70,7 +70,7 @@ $(function() {
Go to the documentation of this file. 70 bool isObjectCreated( void); 81 bool addProcessToJob( const QProcess * const process); 92 bool terminateJob( const quint32 &exitCode); This file contains miscellaneous functions that are generally useful for Qt-based applications...
This class represents a job object. Definition: JobObject.h:46
Global MUtils namespace. Definition: CPUFeatures.h:37
- #define MUTILS_NO_COPY(CLASS) Disables copy constructor and assignment operator in the specified class. This macro should be used i... Definition: Global.h:405
+ #define MUTILS_NO_COPY(CLASS) Disables copy constructor and assignment operator in the specified class. This macro should be used i... Definition: Global.h:416
- Go to the documentation of this file. 34 template< typename K, typename V> class QHash; 43 # ifdef MUTILS_DLL_EXPORT 44 # define MUTILS_API __declspec(dllexport) 46 # ifndef MUTILS_STATIC_LIB 47 # define MUTILS_API __declspec(dllimport) 56 #define MUTILS_MAKE_STRING_HELPER(X) #X 57 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X) 58 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 61 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG)) 62 # define MUTILS_DEBUG (1) 63 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG)) 64 # error Inconsistent DEBUG flags have been detected! 67 # define MUTILS_DEBUG (0) 68 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG) 69 # error Inconsistent DEBUG flags have been detected! 74 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 76 #error We should not enabled SSE or SSE2 in release builds! 117 MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList * const extraPaths = NULL, const QHash<QString, QString> * const extraEnv = NULL); 162 MUTILS_API QString make_temp_file( const QString &basePath, const QString &extension, const bool placeholder = false); 163 MUTILS_API QString make_temp_file( const QDir &basePath, const QString &extension, const bool placeholder = false); 180 MUTILS_API QString make_unique_file( const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 181 MUTILS_API QString make_unique_file( const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 190 MUTILS_API bool parity(quint32 value); 201 MUTILS_API bool remove_file( const QString &fileName); 214 MUTILS_API bool remove_directory( const QString &folderPath, const bool &recursive); 236 MUTILS_API QString& trim_left(QString &str); 247 MUTILS_API QString trim_right( const QString &str); 258 MUTILS_API QString trim_left( const QString &str); 282 MUTILS_API QString clean_file_name( const QString &name, const bool &pretty); 295 MUTILS_API QString clean_file_path( const QString &path, const bool &pretty); 309 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value); 310 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 &value, const size_t &offset); 311 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value, const size_t &offset); 326 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &count); 327 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &count); 328 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 329 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); 356 MUTILS_API int selfTest( const char * const buildKey, const bool debug); 357 static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG); 365 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0) 369 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0) 373 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR))) 377 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16())) 381 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData()) 385 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData()) 389 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR)))) 393 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0") 397 #define MUTILS_BOOLIFY(X) (!(!(X))) 401 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0])) 405 #define MUTILS_NO_COPY(CLASS) \ 406 CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \ 407 CLASS &operator=(const CLASS &) { throw "Assignment operator is disabled!"; } MUTILS_API QStringList available_codepages(const bool &noAliases=true) Retrieve a list of all available codepages.
+ Go to the documentation of this file. 34 template< typename K, typename V> class QHash; 42 #define MUTILS_INTERFACE 2 45 #define MUTILS_BUILD_KEY_HELPER(X,Y) X##" "##Y 46 #define MUTILS_BUILD_KEY MUTILS_BUILD_KEY_HELPER(__DATE__, __TIME__) 50 # ifdef MUTILS_DLL_EXPORT 51 # define MUTILS_API __declspec(dllexport) 53 # ifndef MUTILS_STATIC_LIB 54 # define MUTILS_API __declspec(dllimport) 64 #if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG)) 65 # define MUTILS_DEBUG (1) 66 # if defined(NDEBUG) || defined(QT_NO_DEBUG) || (!defined(QT_DEBUG)) 67 # error Inconsistent DEBUG flags have been detected! 70 # define MUTILS_DEBUG (0) 71 # if (!defined(NDEBUG)) || (!defined(QT_NO_DEBUG)) || defined(QT_DEBUG) 72 # error Inconsistent DEBUG flags have been detected! 77 #if defined(_MSC_VER) && (!defined(__INTELLISENSE__)) && (!defined(_M_X64)) && defined(_M_IX86_FP) 79 #error We should not enabled SSE or SSE2 in release builds! 83 #define MUTILS_MAKE_STRING_HELPER(X) #X 84 #define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X) 85 #define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT)) 87 #define MUTILS_INIT_GLUE_HELPER(X,Y) X##Y 88 #define MUTILS_INIT_GLUE(X,Y) MUTILS_INIT_GLUE_HELPER(X,Y) 89 #define MUTILS_INITIALIZER MUTILS_INIT_GLUE(initialize_, MUTILS_INTERFACE) 128 MUTILS_API void init_process(QProcess &process, const QString &wokringDir, const bool bReplaceTempDir = true, const QStringList * const extraPaths = NULL, const QHash<QString, QString> * const extraEnv = NULL); 173 MUTILS_API QString make_temp_file( const QString &basePath, const QString &extension, const bool placeholder = false); 174 MUTILS_API QString make_temp_file( const QDir &basePath, const QString &extension, const bool placeholder = false); 191 MUTILS_API QString make_unique_file( const QString &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 192 MUTILS_API QString make_unique_file( const QDir &basePath, const QString &baseName, const QString &extension, const bool fancy = false, const bool placeholder = false); 201 MUTILS_API bool parity(quint32 value); 212 MUTILS_API bool remove_file( const QString &fileName); 225 MUTILS_API bool remove_directory( const QString &folderPath, const bool &recursive); 247 MUTILS_API QString& trim_left(QString &str); 258 MUTILS_API QString trim_right( const QString &str); 269 MUTILS_API QString trim_left( const QString &str); 293 MUTILS_API QString clean_file_name( const QString &name, const bool &pretty); 306 MUTILS_API QString clean_file_path( const QString &path, const bool &pretty); 320 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value); 321 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 &value, const size_t &offset); 322 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 &value, const size_t &offset); 337 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &count); 338 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &count); 339 MUTILS_API bool regexp_parse_uint32( const QRegExp ®exp, quint32 *values, const size_t &offset, const size_t &count); 340 MUTILS_API bool regexp_parse_int32( const QRegExp ®exp, qint32 *values, const size_t &offset, const size_t &count); 367 MUTILS_API int MUTILS_INITIALIZER( const char * const buildKey, const bool debug); 368 static const int s_initializedFlag = MUTILS_INITIALIZER(MUTILS_BUILD_KEY, MUTILS_DEBUG); 376 #define MUTILS_DELETE(PTR) do { if((PTR)) { delete (PTR); (PTR) = NULL; } } while(0) 380 #define MUTILS_DELETE_ARRAY(PTR) do { if((PTR)) { delete [] (PTR); (PTR) = NULL; } } while(0) 384 #define MUTILS_ZERO_MEMORY(PTR) memset(&(PTR), 0, sizeof((PTR))) 388 #define MUTILS_WCHR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16())) 392 #define MUTILS_UTF8(STR) ((STR).toUtf8().constData()) 396 #define MUTILS_L1STR(STR) ((STR).toLatin1().constData()) 400 #define MUTILS_QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR)))) 404 #define MUTILS_BOOL2STR(X) ((X) ? "1" : "0") 408 #define MUTILS_BOOLIFY(X) (!(!(X))) 412 #define MUTILS_ARR2LEN(X) (sizeof((X)) / sizeof((X)[0])) 416 #define MUTILS_NO_COPY(CLASS) \ 417 CLASS(const CLASS &) { throw "Copy constructor is disabled!"; } \ 418 CLASS &operator=(const CLASS &) { throw "Assignment operator is disabled!"; } MUTILS_API QStringList available_codepages(const bool &noAliases=true) Retrieve a list of all available codepages.
struct MUtils::_fp_parts_t fp_parts_t This struct containes the parts (integral and fractional part) of a floating-point number...
MUTILS_API QString next_rand_str(const bool &bLong=false) Generates a random string.
MUTILS_API bool remove_file(const QString &fileName) Deletes the specified file.
MUTILS_API QString clean_file_path(const QString &path, const bool &pretty) Clean up a file path string.
- This struct containes the parts (integral and fractional part) of a floating-point number... Definition: Global.h:93
+ This struct containes the parts (integral and fractional part) of a floating-point number... Definition: Global.h:104
MUTILS_API void natural_string_sort(QStringList &list, const bool bIgnoreCase) Sort a list of strings using "natural ordering" algorithm.
MUTILS_API bool regexp_parse_uint32(const QRegExp ®exp, quint32 &value) Parse regular expression results.
MUTILS_API bool parity(quint32 value) Computes the parity of the given unsigned 32-Bit value.
diff --git a/include/MUtils/Global.h b/include/MUtils/Global.h
index 48ea302..c56d8f1 100644
--- a/include/MUtils/Global.h
+++ b/include/MUtils/Global.h
@@ -38,6 +38,13 @@ template class QHash;
/** \cond INTERNAL
*/
+ //Interface version
+#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
#ifdef _MSC_VER
# ifdef MUTILS_DLL_EXPORT
@@ -53,10 +60,6 @@ template class QHash;
# define MUTILS_API
#endif
-#define MUTILS_MAKE_STRING_HELPER(X) #X
-#define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
-#define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
-
//Check Debug Flags
#if defined(_DEBUG) || defined(DEBUG) || (!defined(NDEBUG))
# define MUTILS_DEBUG (1)
@@ -77,6 +80,14 @@ template class QHash;
#endif
#endif
+#define MUTILS_MAKE_STRING_HELPER(X) #X
+#define MUTILS_MAKE_STRING(X) MUTILS_MAKE_STRING_HELPER(X)
+#define MUTILS_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" MUTILS_MAKE_STRING(__LINE__) ") : warning: " TXT))
+
+#define MUTILS_INIT_GLUE_HELPER(X,Y) X##Y
+#define MUTILS_INIT_GLUE(X,Y) MUTILS_INIT_GLUE_HELPER(X,Y)
+#define MUTILS_INITIALIZER MUTILS_INIT_GLUE(initialize_, MUTILS_INTERFACE)
+
/** \endcond INTERNAL
*/
@@ -353,8 +364,8 @@ namespace MUtils
//Internal
namespace Internal
{
- MUTILS_API int selfTest(const char *const buildKey, const bool debug);
- static const int s_selfTest = selfTest(__DATE__ "@" __TIME__, MUTILS_DEBUG);
+ MUTILS_API int MUTILS_INITIALIZER(const char *const buildKey, const bool debug);
+ static const int s_initializedFlag = MUTILS_INITIALIZER(MUTILS_BUILD_KEY, MUTILS_DEBUG);
}
}
diff --git a/src/Global.cpp b/src/Global.cpp
index 056d213..da1dc7d 100644
--- a/src/Global.cpp
+++ b/src/Global.cpp
@@ -902,19 +902,20 @@ MUtils::fp_parts_t MUtils::break_fp(const double value)
}
///////////////////////////////////////////////////////////////////////////////
-// SELF-TEST
+// INITIALIZER
///////////////////////////////////////////////////////////////////////////////
-int MUtils::Internal::selfTest(const char *const buildKey, const bool debug)
+int MUtils::Internal::MUTILS_INITIALIZER(const char *const buildKey, const bool debug)
{
- static const bool MY_DEBUG_FLAG = MUTILS_DEBUG;
- static const char *const MY_BUILD_KEY = __DATE__ "@" __TIME__;
+ static const bool INTERNAL_DEBUG_FLAG = MUTILS_DEBUG;
+ static const char *const INTERNAL_BUILD_KEY = MUTILS_BUILD_KEY;
- if(strncmp(buildKey, MY_BUILD_KEY, 13) || (MY_DEBUG_FLAG != debug))
+ if((debug != INTERNAL_DEBUG_FLAG) || strncmp(buildKey, INTERNAL_BUILD_KEY, 11))
{
- MUtils::OS::system_message_err(L"MUtils", L"FATAL ERROR: MUtils library version mismatch detected!");
- MUtils::OS::system_message_wrn(L"MUtils", L"Perform a clean(!) re-install of the application to fix the problem!");
+ MUtils::OS::system_message_err(L"MUtils", L"FATAL ERROR: MUtils library initialization has failed");
abort();
}
- return 0;
+
+ volatile int _result = MUTILS_INTERFACE;
+ return _result;
}
|