diff --git a/src/shared/Database/Field.h b/src/shared/Database/Field.h index 8f23311aa..3f89b5886 100644 --- a/src/shared/Database/Field.h +++ b/src/shared/Database/Field.h @@ -39,6 +39,7 @@ class Field ~Field(); enum DataTypes GetType() const { return mType; } + bool IsNULL() const { return mValue == NULL; } const char *GetString() const { return mValue; } std::string GetCppString() const diff --git a/src/shared/Log.h b/src/shared/Log.h index e1eb66a1b..1e9eb435f 100644 --- a/src/shared/Log.h +++ b/src/shared/Log.h @@ -192,30 +192,47 @@ class Log : public MaNGOS::Singleton::Instance() -#define BASIC_LOG(...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_BASIC)) \ - sLog.outBasic(__VA_ARGS__) -#define BASIC_FILTER_LOG(F,...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_BASIC) && (sLog.getLogFilter() & (F))==0) \ - sLog.outBasic(__VA_ARGS__) +#define BASIC_LOG(...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_BASIC)) \ + sLog.outBasic(__VA_ARGS__); \ + } while(0) -#define DETAIL_LOG(...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_DETAIL)) \ - sLog.outDetail(__VA_ARGS__) -#define DETAIL_FILTER_LOG(F,...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_DETAIL) && (sLog.getLogFilter() & (F))==0) \ - sLog.outDetail(__VA_ARGS__) +#define BASIC_FILTER_LOG(F,...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_BASIC) && (sLog.getLogFilter() & (F))==0) \ + sLog.outBasic(__VA_ARGS__); \ + } while(0) -#define DEBUG_LOG(...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) \ - sLog.outDebug(__VA_ARGS__) -#define DEBUG_FILTER_LOG(F,...) \ - if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG) && (sLog.getLogFilter() & (F))==0) \ - sLog.outDebug(__VA_ARGS__) +#define DETAIL_LOG(...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_DETAIL)) \ + sLog.outDetail(__VA_ARGS__); \ + } while(0) -#define ERROR_DB_FILTER_LOG(F,...) \ - if ((sLog.getLogFilter() & (F))==0) \ - sLog.outErrorDb(__VA_ARGS__) +#define DETAIL_FILTER_LOG(F,...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_DETAIL) && (sLog.getLogFilter() & (F))==0) \ + sLog.outDetail(__VA_ARGS__); \ + } while(0) + +#define DEBUG_LOG(...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) \ + sLog.outDebug(__VA_ARGS__); \ + } while(0) + +#define DEBUG_FILTER_LOG(F,...) \ + do { \ + if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG) && (sLog.getLogFilter() & (F))==0) \ + sLog.outDebug(__VA_ARGS__); \ + } while(0) + +#define ERROR_DB_FILTER_LOG(F,...) \ + do { \ + if ((sLog.getLogFilter() & (F))==0) \ + sLog.outErrorDb(__VA_ARGS__); \ + } while(0) #define ERROR_DB_STRICT_LOG(...) \ ERROR_DB_FILTER_LOG(LOG_FILTER_DB_STRICTED_CHECK, __VA_ARGS__) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1dc065b59..92187b2cb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10024" + #define REVISION_NR "10025" #endif // __REVISION_NR_H__