diff options
author | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-15 03:42:29 +0000 |
---|---|---|
committer | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-15 03:42:29 +0000 |
commit | b559f293f6f8f07bc54b2646f8137aaaf2e213d5 (patch) | |
tree | 5df0e6b0082e9c272ca90abdbbb3151965a31600 /code/qcommon | |
parent | 532c1fa910630b094bc20d48df4587d9edc11b4d (diff) | |
download | ioquake3-aero-b559f293f6f8f07bc54b2646f8137aaaf2e213d5.tar.gz ioquake3-aero-b559f293f6f8f07bc54b2646f8137aaaf2e213d5.zip |
Added Intel CC compatibility to vm_x86.c's inline asm.
Fixes Bugzilla #3338.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1613 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/vm_x86.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index 7dee658..64c2ed4 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -176,9 +176,15 @@ _asm { #else //!_MSC_VER #if defined(__MINGW32__) || defined(MACOS_X) // _ is prepended to compiled symbols -# define CMANG(sym) "_"#sym +#define CMANGVAR(sym) "_"#sym +#define CMANGFUNC(sym) "_"#sym #else -# define CMANG(sym) #sym +#if defined(__ICC) && (__ICC >= 1000) +#define CMANGVAR(sym) #sym".0" +#define CMANGFUNC(sym) #sym +#else +#define CMANGVAR(sym) #sym +#define CMANGFUNC(sym) #sym #endif static void __attribute__((cdecl, used)) CallAsmCall(int const syscallNum, @@ -199,18 +205,18 @@ __asm__( ".text\n\t" ".p2align 4,,15\n\t" #if defined __ELF__ - ".type " CMANG(AsmCall) ", @function\n" + ".type " CMANGFUNC(AsmCall) ", @function\n" #endif - CMANG(AsmCall) ":\n\t" + CMANGFUNC(AsmCall) ":\n\t" "movl (%edi), %eax\n\t" "subl $4, %edi\n\t" "testl %eax, %eax\n\t" "jl 0f\n\t" "shll $2, %eax\n\t" - "addl " CMANG(instructionPointers) ", %eax\n\t" + "addl " CMANGVAR(instructionPointers) ", %eax\n\t" "call *(%eax)\n\t" "movl (%edi), %eax\n\t" - "andl " CMANG(callMask) ", %eax\n\t" + "andl " CMANGVAR(callMask) ", %eax\n\t" "ret\n" "0:\n\t" // system call "notl %eax\n\t" @@ -221,7 +227,7 @@ __asm__( "pushl %edi\n\t" // opStack "pushl %esi\n\t" // programStack "pushl %eax\n\t" // syscallNum - "call " CMANG(CallAsmCall) "\n\t" + "call " CMANGFUNC(CallAsmCall) "\n\t" "addl $12, %esp\n\t" "popl %ecx\n\t" "movl %ebp, %esp\n\t" @@ -229,7 +235,7 @@ __asm__( "addl $4, %edi\n\t" "ret\n\t" #if defined __ELF__ - ".size " CMANG(AsmCall)", .-" CMANG(AsmCall) + ".size " CMANGFUNC(AsmCall)", .-" CMANGFUNC(AsmCall) #endif ); |