2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Merge pull request #294 from theAsmodai/noxref_err_icc

Added correct noxref error message for ICC linux builds
This commit is contained in:
theAsmodai 2016-12-30 16:32:40 +03:00 committed by GitHub
commit 22ca60c764

View File

@ -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