2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-27 14:08:23 +03:00

Fix compilation

This commit is contained in:
asmodai 2017-06-26 22:11:14 +03:00
parent 3f25635fa5
commit bb600d0e13
4 changed files with 30 additions and 7 deletions

View File

@ -54,8 +54,6 @@ CForwardCallbackJIT::CForwardCallbackJIT(jitdata_t* jitdata) : m_jitdata(jitdata
void CForwardCallbackJIT::naked_main()
{
//jit_debug("Enter %s\n", m_jitdata->name);
// prologue
push(ebx);
push(ebp);
@ -154,7 +152,6 @@ void CForwardCallbackJIT::naked_main()
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);
mov(edx, dword_ptr[globals + mg_mres]);
@ -178,7 +175,6 @@ void CForwardCallbackJIT::naked_main()
jz("skip_original");
{
if (m_jitdata->pfn_original) {
//jit_debug("Call original %s\n", m_jitdata->name);
mov(ecx, m_jitdata->pfn_original);
call_func(ecx);
}
@ -235,7 +231,6 @@ void CForwardCallbackJIT::naked_main()
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);
mov(edx, dword_ptr[globals + mg_mres]);
@ -275,7 +270,6 @@ void CForwardCallbackJIT::naked_main()
mov(esp, ebp);
pop(ebp);
pop(ebx);
//jit_debug("Leave %s\n", m_jitdata->name);
ret();
}

23
metamod/src/mdebug.cpp Normal file
View 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
View File

@ -0,0 +1,6 @@
#pragma once
//#define JIT_DEBUG
//#define JIT_DEBUG_FILE
void mdebug_to_file(const char* fmt, ...);

View File

@ -247,7 +247,7 @@ bool MPluginList::ini_startup()
META_LOG("ini: Begin reading plugins list: %s", m_inifile);
for (n = 0 , ln = 1; !feof(fp) && fgets(line, sizeof line, fp); ln++) {
auto plug = new MPlugin();
memset(plug, 0, sizeof MPlugin);
memset(plug, 0, sizeof(MPlugin));
// Remove line terminations.
char* cp;