From 085c8b8017763f5effc328ad131e4302c3a1ac8e Mon Sep 17 00:00:00 2001 From: asmodai Date: Thu, 29 Dec 2016 01:22:56 +0300 Subject: [PATCH] Added correct noxref error message for ICC linux builds --- rehlds/engine/sys_dll.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rehlds/engine/sys_dll.h b/rehlds/engine/sys_dll.h index 7940694..3df8e6e 100644 --- a/rehlds/engine/sys_dll.h +++ b/rehlds/engine/sys_dll.h @@ -41,10 +41,18 @@ #define __HACK_LINE_AS_STRING__(x) CONST_INTEGER_AS_STRING(x) //__LINE__ can only be converted to an actual number by going through this, otherwise the output is literally "__LINE__" #define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form -#ifdef _WIN32 +#if defined _MSC_VER || defined __INTEL_COMPILER #define NOXREFCHECK __asm { push [ebp + 4] } Sys_Error("[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":"__LINE__AS_STRING") NOXREF, but called from 0x%.08x") #else -#define NOXREFCHECK int *a = 0; *a = 0 +#define NOXREFCHECK const char* noxref_msg = "[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":"__LINE__AS_STRING") NOXREF, but called from 0x%.08x"; \ + asm volatile ( \ + "pushl 4(%%ebp)\n\t" \ + "pushl %0\n\t" \ + "call $Sys_Error\n\t" \ + "addl %%esp, $8\n\t" \ + :: \ + "m" (noxref_msg) \ + ); #endif