forked from TeamTofuShop/segatools
fix msvc compilation
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include "hooklib/procaddr.h"
|
||||
|
||||
@ -83,6 +82,13 @@ static void proc_addr_hook_init(void)
|
||||
_countof(win32_hooks));
|
||||
}
|
||||
|
||||
#define PATH_MAX 1024
|
||||
char *gnu_basename(char *path)
|
||||
{
|
||||
char *base = strrchr(path, '/');
|
||||
return base ? base+1 : path;
|
||||
}
|
||||
|
||||
FARPROC WINAPI my_GetProcAddress(HMODULE hModule, const char *name)
|
||||
{
|
||||
uintptr_t ordinal = (uintptr_t) name;
|
||||
@ -92,7 +98,7 @@ FARPROC WINAPI my_GetProcAddress(HMODULE hModule, const char *name)
|
||||
FARPROC result = next_GetProcAddress(hModule, name);
|
||||
|
||||
GetModuleFileNameA(hModule, mod_path, PATH_MAX);
|
||||
mod_name = basename(mod_path);
|
||||
mod_name = gnu_basename(mod_path);
|
||||
|
||||
for (int i = 0; i < proc_addr_hook_count; i++) {
|
||||
|
||||
|
Reference in New Issue
Block a user