Commit 318529d8 authored by captainwong's avatar captainwong

update

parent b4c5f6ca
This diff is collapsed.
#pragma once
inline wchar_t* FormatWSAError(int errornumber)
namespace jlib
{
inline wchar_t* FormatWSAError(int errornumber)
{
switch (errornumber) {
case WSANOTINITIALISED:
return L"A successful WSAStartup call must occur before using this function. ";
......@@ -78,4 +79,6 @@ inline wchar_t* FormatWSAError(int errornumber)
return buf;
}break;
}
}
\ No newline at end of file
}
};
......@@ -6,26 +6,27 @@
#include "mtverify.h"
#include "FileOper.h"
#include "Log.h"
#define LOG CLog::WriteLog
#define LOGA CLog::WriteLogA
#define LOGW CLog::WriteLogW
#define LOGB(b, l) CLog::Dump(b, l)
#define LOGASC(b, l) CLog::DumpAsc(b, l)
#include "MyWSAError.h"
#include "observer_macro.h"
namespace jlib {
#define JLOG CLog::WriteLog
#define JLOGA CLog::WriteLogA
#define JLOGW CLog::WriteLogW
#define JLOGB(b, l) CLog::Dump(b, l)
#define JLOGASC(b, l) CLog::DumpAsc(b, l)
class LogFunction {
private:
const char* _func_name;
public:
LogFunction(const char* func_name) : _func_name(func_name) { LOGA("%s in\n", _func_name); }
~LogFunction() { LOGA("%s out\n", _func_name); }
LogFunction(const char* func_name) : _func_name(func_name) { JLOGA("%s in\n", _func_name); }
~LogFunction() { JLOGA("%s out\n", _func_name); }
};
#define LOG_FUNCTION(func_name) LogFunction _log_function_object(func_name);
#define AUTO_LOG_FUNCTION LOG_FUNCTION(__FUNCTION__)
#include "MyWSAError.h"
#include "observer_macro.h"
#define NAMESPACE_END };
#define DECLARE_UNCOPYABLE(classname) \
......@@ -105,3 +106,5 @@ public: \
#define INITIALIZE_STRING(val) { val = new wchar_t[1]; val[0] = 0; }
};
#pragma once
namespace jlib {
// place this macro in your class's header file, in your class's definition
#define DECLARE_OBSERVER(callback, param_type) \
protected: \
......@@ -70,7 +72,7 @@ void class_name::NotifyObservers(_param_type param) \
_observerList.clear(); \
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment