Merge CRT changes from cmake branch (mainly MSVC compilation fixes)

svn path=/trunk/; revision=50647
This commit is contained in:
Timo Kreuzer 2011-02-10 11:35:05 +00:00
parent 5c40e3e852
commit f24d76dc84
26 changed files with 154 additions and 9 deletions

View file

@ -45,6 +45,9 @@ static inline void *call_ebp_func( void *func, void *ebp )
{
void *ret;
int dummy;
#ifdef _MSC_VER
#pragma message ("call_ebp_func is unimplemented for MSC")
#else
__asm__ __volatile__ ("pushl %%ebx\n\t"
"pushl %%ebp\n\t"
"movl %4,%%ebp\n\t"
@ -53,6 +56,7 @@ static inline void *call_ebp_func( void *func, void *ebp )
"popl %%ebx"
: "=a" (ret), "=S" (dummy), "=D" (dummy)
: "0" (func), "1" (ebp) : "ecx", "edx", "memory" );
#endif
return ret;
}
@ -60,6 +64,9 @@ static inline void *call_ebp_func( void *func, void *ebp )
static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase )
{
TRACE( "calling copy ctor %p object %p src %p\n", func, this, src );
#ifdef _MSC_VER
#pragma message ("call_copy_ctor is unimplemented for MSC")
#else
if (has_vbase)
/* in that case copy ctor takes an extra bool indicating whether to copy the base class */
__asm__ __volatile__("pushl $1; pushl %2; call *%0"
@ -67,19 +74,28 @@ static inline void call_copy_ctor( void *func, void *this, void *src, int has_vb
else
__asm__ __volatile__("pushl %2; call *%0"
: : "r" (func), "c" (this), "r" (src) : "eax", "edx", "memory" );
#endif
}
/* call the destructor of the exception object */
static inline void call_dtor( void *func, void *object )
{
#ifdef _MSC_VER
#pragma message ("call_dtor is unimplemented for MSC")
#else
__asm__ __volatile__("call *%0" : : "r" (func), "c" (object) : "eax", "edx", "memory" );
#endif
}
/* continue execution to the specified address after exception is caught */
static inline void DECLSPEC_NORETURN continue_after_catch( cxx_exception_frame* frame, void *addr )
{
#ifdef _MSC_VER
#pragma message ("continue_after_catch is unimplemented for MSC")
#else
__asm__ __volatile__("movl -4(%0),%%esp; leal 12(%0),%%ebp; jmp *%1"
: : "r" (frame), "a" (addr) );
#endif
for (;;) ; /* unreached */
}
@ -415,6 +431,14 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame
*/
extern DWORD CDECL __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame,
PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch );
#ifdef _MSC_VER
#pragma message ("__CxxFrameHandler is unimplemented for MSC")
DWORD CDECL __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame,
PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch )
{
return 0;
}
#else
__ASM_GLOBAL_FUNC( __CxxFrameHandler,
"pushl $0\n\t" /* nested_trylevel */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
@ -434,7 +458,7 @@ __ASM_GLOBAL_FUNC( __CxxFrameHandler,
"add $28,%esp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -28\n\t")
"ret" )
#endif
/*********************************************************************
* __CxxLongjmpUnwind (MSVCRT.@)