mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-01-28 22:47:54 +03:00
Fix compilation
This commit is contained in:
parent
3f25635fa5
commit
bb600d0e13
@ -54,8 +54,6 @@ CForwardCallbackJIT::CForwardCallbackJIT(jitdata_t* jitdata) : m_jitdata(jitdata
|
|||||||
|
|
||||||
void CForwardCallbackJIT::naked_main()
|
void CForwardCallbackJIT::naked_main()
|
||||||
{
|
{
|
||||||
//jit_debug("Enter %s\n", m_jitdata->name);
|
|
||||||
|
|
||||||
// prologue
|
// prologue
|
||||||
push(ebx);
|
push(ebx);
|
||||||
push(ebp);
|
push(ebp);
|
||||||
@ -154,7 +152,6 @@ void CForwardCallbackJIT::naked_main()
|
|||||||
mov(dword_ptr[globals + mg_prev_mres], eax);
|
mov(dword_ptr[globals + mg_prev_mres], eax);
|
||||||
}
|
}
|
||||||
|
|
||||||
//jit_debug("Calling pre [%s] for plug [%s]\n", m_jitdata->name, plug->description());
|
|
||||||
call_func(ecx);
|
call_func(ecx);
|
||||||
|
|
||||||
mov(edx, dword_ptr[globals + mg_mres]);
|
mov(edx, dword_ptr[globals + mg_mres]);
|
||||||
@ -178,7 +175,6 @@ void CForwardCallbackJIT::naked_main()
|
|||||||
jz("skip_original");
|
jz("skip_original");
|
||||||
{
|
{
|
||||||
if (m_jitdata->pfn_original) {
|
if (m_jitdata->pfn_original) {
|
||||||
//jit_debug("Call original %s\n", m_jitdata->name);
|
|
||||||
mov(ecx, m_jitdata->pfn_original);
|
mov(ecx, m_jitdata->pfn_original);
|
||||||
call_func(ecx);
|
call_func(ecx);
|
||||||
}
|
}
|
||||||
@ -235,7 +231,6 @@ void CForwardCallbackJIT::naked_main()
|
|||||||
mov(dword_ptr[globals + mg_prev_mres], eax);
|
mov(dword_ptr[globals + mg_prev_mres], eax);
|
||||||
}
|
}
|
||||||
|
|
||||||
//jit_debug("Calling post [%s] for plug [%s]\n", m_jitdata->name, plug->description());
|
|
||||||
call_func(ecx);
|
call_func(ecx);
|
||||||
|
|
||||||
mov(edx, dword_ptr[globals + mg_mres]);
|
mov(edx, dword_ptr[globals + mg_mres]);
|
||||||
@ -275,7 +270,6 @@ void CForwardCallbackJIT::naked_main()
|
|||||||
mov(esp, ebp);
|
mov(esp, ebp);
|
||||||
pop(ebp);
|
pop(ebp);
|
||||||
pop(ebx);
|
pop(ebx);
|
||||||
//jit_debug("Leave %s\n", m_jitdata->name);
|
|
||||||
ret();
|
ret();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
metamod/src/mdebug.cpp
Normal file
23
metamod/src/mdebug.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include "precompiled.h"
|
||||||
|
|
||||||
|
void mdebug_to_file(const char* fmt, ...)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
va_list argptr;
|
||||||
|
va_start(argptr, fmt);
|
||||||
|
vsnprintf(buf, sizeof buf, fmt, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
|
||||||
|
FILE* fp = fopen("mdebug.log", "a");
|
||||||
|
if (fp) {
|
||||||
|
time_t td;
|
||||||
|
time(&td);
|
||||||
|
|
||||||
|
char date[32];
|
||||||
|
strftime(date, 31, "%m/%d/%Y - %H:%M:%S", localtime(&td));
|
||||||
|
|
||||||
|
fprintf(fp, "%s: %s", date, buf);
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
}
|
6
metamod/src/mdebug.h
Normal file
6
metamod/src/mdebug.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
//#define JIT_DEBUG
|
||||||
|
//#define JIT_DEBUG_FILE
|
||||||
|
|
||||||
|
void mdebug_to_file(const char* fmt, ...);
|
@ -247,7 +247,7 @@ bool MPluginList::ini_startup()
|
|||||||
META_LOG("ini: Begin reading plugins list: %s", m_inifile);
|
META_LOG("ini: Begin reading plugins list: %s", m_inifile);
|
||||||
for (n = 0 , ln = 1; !feof(fp) && fgets(line, sizeof line, fp); ln++) {
|
for (n = 0 , ln = 1; !feof(fp) && fgets(line, sizeof line, fp); ln++) {
|
||||||
auto plug = new MPlugin();
|
auto plug = new MPlugin();
|
||||||
memset(plug, 0, sizeof MPlugin);
|
memset(plug, 0, sizeof(MPlugin));
|
||||||
|
|
||||||
// Remove line terminations.
|
// Remove line terminations.
|
||||||
char* cp;
|
char* cp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user