Fixed pragmas

This commit is contained in:
mudlord 2008-05-29 04:05:38 +00:00
parent 92cc48428b
commit 05769eba13
1 changed files with 3 additions and 2 deletions

View File

@ -10,15 +10,16 @@ extern "C" {
int ExecutableValid(const char *executable_filename);
char *unprotect_buffer(unsigned char *buffer, size_t buffer_len);
#pragma optimize("", off)
#define SET_FN_PTR(func, num) \
#pragma optimize("", off) \
static __inline void *get_##func(void) { \
int i, j = num / 4; \
long ptr = (long)func + num; \
for (i = 0; i < 2; i++) { ptr -= j; } \
return (void *)(ptr - (j * 2)); \
} \
#pragma optimize("", on)
#pragma optimize("", on)
#define GET_FN_PTR(func) get_##func()