fix: restore linux mingw client build and gm smoke
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
file(GLOB_RECURSE FILE_SOURCES "*.h" "*.c" "*.cpp")
|
||||
|
||||
foreach(_source IN LISTS FILE_SOURCES)
|
||||
if(IS_SYMLINK "${_source}")
|
||||
list(REMOVE_ITEM FILE_SOURCES "${_source}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_library(EterBase STATIC ${FILE_SOURCES})
|
||||
|
||||
target_link_libraries(EterBase
|
||||
|
||||
@@ -19,7 +19,6 @@ extern void Tracenf(const char* c_szFormat, ...);
|
||||
extern void Tracef(const char* c_szFormat, ...);
|
||||
extern void TraceError(const char* c_szFormat, ...);
|
||||
extern void TraceErrorWithoutEnter(const char* c_szFormat, ...);
|
||||
// MR-11: Separate packet dump log from the main log file
|
||||
extern void TempTrace(const char* c_szMsg, bool errType = false);
|
||||
extern void TempTracef(const char* c_szFormat, bool errType = false, ...);
|
||||
extern void TempTracen(const char* c_szMsg, bool errType = false);
|
||||
@@ -27,13 +26,12 @@ extern void TempTracenf(const char* c_szFormat, bool errType = false, ...);
|
||||
|
||||
extern void PacketDump(const char* c_szMsg);
|
||||
extern void PacketDumpf(const char* c_szFormat, ...);
|
||||
// MR-11: -- END OF -- Separate packet dump log from the main log file
|
||||
|
||||
extern void LogBox(const char* c_szMsg, const char * c_szCaption = NULL, HWND hWnd = NULL);
|
||||
extern void LogBox(const char* c_szMsg, const char* c_szCaption = NULL, HWND hWnd = NULL);
|
||||
extern void LogBoxf(const char* c_szMsg, ...);
|
||||
|
||||
extern void LogFile(const char* c_szMsg);
|
||||
extern void LogFilef(const char * c_szMessage, ...);
|
||||
extern void LogFilef(const char* c_szMessage, ...);
|
||||
extern void OpenConsoleWindow(void);
|
||||
extern void CloseConsoleWindow();
|
||||
extern void SetupLog(void);
|
||||
@@ -43,12 +41,12 @@ extern void CloseLogFile();
|
||||
|
||||
extern HWND g_PopupHwnd;
|
||||
|
||||
#define CHECK_RETURN(flag, string) \
|
||||
if (flag) \
|
||||
{ \
|
||||
LogBox(string); \
|
||||
return; \
|
||||
} \
|
||||
#define CHECK_RETURN(flag, string) \
|
||||
if (flag) \
|
||||
{ \
|
||||
LogBox(string); \
|
||||
return; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,83 +3,80 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
template <typename T> class CSingleton
|
||||
{
|
||||
static T * ms_singleton;
|
||||
|
||||
public:
|
||||
template <typename T> class CSingleton
|
||||
{
|
||||
static T* ms_singleton;
|
||||
|
||||
public:
|
||||
CSingleton()
|
||||
{
|
||||
{
|
||||
assert(!ms_singleton);
|
||||
intptr_t offset = (intptr_t) (T*) 1 - (intptr_t) (CSingleton <T>*) (T*) 1;
|
||||
ms_singleton = (T*) ((intptr_t) this + offset);
|
||||
}
|
||||
intptr_t offset = (intptr_t)(T*)1 - (intptr_t)(CSingleton<T>*)(T*)1;
|
||||
ms_singleton = (T*)((intptr_t)this + offset);
|
||||
}
|
||||
|
||||
virtual ~CSingleton()
|
||||
{
|
||||
{
|
||||
assert(ms_singleton);
|
||||
ms_singleton = 0;
|
||||
ms_singleton = 0;
|
||||
}
|
||||
|
||||
__forceinline static T & Instance()
|
||||
__forceinline static T& Instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T * InstancePtr()
|
||||
{
|
||||
__forceinline static T* InstancePtr()
|
||||
{
|
||||
return (ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T & instance()
|
||||
__forceinline static T& instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> T * CSingleton <T>::ms_singleton = 0;
|
||||
template <typename T> T* CSingleton<T>::ms_singleton = 0;
|
||||
|
||||
//
|
||||
// singleton for non-hungarian
|
||||
//
|
||||
template <typename T> class singleton
|
||||
{
|
||||
static T * ms_singleton;
|
||||
|
||||
public:
|
||||
{
|
||||
static T* ms_singleton;
|
||||
|
||||
public:
|
||||
singleton()
|
||||
{
|
||||
{
|
||||
assert(!ms_singleton);
|
||||
intptr_t offset = (intptr_t) (T*) 1 - (intptr_t) (singleton <T>*) (T*) 1;
|
||||
ms_singleton = (T*) ((intptr_t) this + offset);
|
||||
}
|
||||
intptr_t offset = (intptr_t)(T*)1 - (intptr_t)(singleton<T>*)(T*)1;
|
||||
ms_singleton = (T*)((intptr_t)this + offset);
|
||||
}
|
||||
|
||||
virtual ~singleton()
|
||||
{
|
||||
{
|
||||
assert(ms_singleton);
|
||||
ms_singleton = 0;
|
||||
ms_singleton = 0;
|
||||
}
|
||||
|
||||
__forceinline static T & Instance()
|
||||
__forceinline static T& Instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T * InstancePtr()
|
||||
{
|
||||
__forceinline static T* InstancePtr()
|
||||
{
|
||||
return (ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T & instance()
|
||||
__forceinline static T& instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> T * singleton <T>::ms_singleton = 0;
|
||||
template <typename T> T* singleton<T>::ms_singleton = 0;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,6 +80,7 @@ LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo)
|
||||
fprintf(fException, "rcx: 0x%016llx\trdx: 0x%016llx\n", context.Rcx, context.Rdx);
|
||||
fprintf(fException, "rsi: 0x%016llx\trdi: 0x%016llx\n", context.Rsi, context.Rdi);
|
||||
fprintf(fException, "rbp: 0x%016llx\trsp: 0x%016llx\n", context.Rbp, context.Rsp);
|
||||
fprintf(fException, "rip: 0x%016llx\n", context.Rip);
|
||||
fprintf(fException, "\n");
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user