TL DR In GCC, it is only available for: ARM, AVR, MCORE, MSP430, NDS32, RL78, RX and SPU
It is NOT available on x86 .
Workaround (suggested by Brandon in the comments) .
( , )
, Windows, __declspec GCC.
MSDN __declspec:
Microsoft C ++.
GCC.
GCC:
. Windows GCC - , __declspec (dllexport) void (* foo) (void) void (__declspec (dllexport) * foo) (void) - GCC.
, , __declspec GCC ( ).
, __declspec, GCC, __declspec(dllexport) ( GCC ).
, , GCC
( ) , , . , . ,
__attribute__((noreturn)) void d0 (void),
__attribute__((format(printf, 1, 2))) d1 (const char *, ...),
d2 (void)
noreturn ; format d1.
, :
#ifdef __GNUC__
#define ATTRIBUTE_NAKED __attribute__((naked))
#else
#define ATTRIBUTE_NAKED __declspec(naked)
#endif
ATTRIBUTE_NAKED void DXHook_D3DPERF_BeginEvent()
{
#ifdef _MSC_VER
__asm{jmp[Addr]}
#else
__asm("jmp *%0"
:
: "r" (Addr)
: "%eax");
#endif
}
Edit:
, . :
ARM, AVR, MCORE, MSP430, NDS32, RL78, RX SPU. , - . /, . asm (. Basic Asm). asm asm C , , , .
GCC .
clang ( , GCC), , , GCC.