Further changes to compile using MSVC.

This commit is contained in:
kai 2012-05-23 17:36:26 +02:00
parent bb2ca5b4f5
commit 48f8ffeb0b
6 changed files with 26 additions and 9 deletions

View file

@ -37,13 +37,14 @@
#if !IN_LLVM
#include "lib.h"
#include "json.h"
#endif
#if WINDOWS_SEH
#include <windows.h>
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
#endif
#if !IN_LLVM
int response_expand(int *pargc, char ***pargv);
void browse(const char *url);
void getenv_setargv(const char *envvar, int *pargc, char** *pargv);
@ -1617,3 +1618,19 @@ Ldone:
*pargc = argc;
*pargv = argv->tdata();
}
#if WINDOWS_SEH
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep)
{
//printf("%x\n", ep->ExceptionRecord->ExceptionCode);
if (ep->ExceptionRecord->ExceptionCode == STATUS_STACK_OVERFLOW)
{
#if 1 //ndef DEBUG
return EXCEPTION_EXECUTE_HANDLER;
#endif
}
return EXCEPTION_CONTINUE_SEARCH;
}
#endif

View file

@ -412,11 +412,11 @@ DValue* ComplexExp::toElem(IRState* p)
if (c->isNullValue()) {
Type* t = type->toBasetype();
if (t->ty == Tcomplex32)
c = DtoConstFP(Type::tfloat32, 0);
c = DtoConstFP(Type::tfloat32, ldouble(0));
else if (t->ty == Tcomplex64)
c = DtoConstFP(Type::tfloat64, 0);
c = DtoConstFP(Type::tfloat64, ldouble(0));
else if (t->ty == Tcomplex80)
c = DtoConstFP(Type::tfloat80, 0);
c = DtoConstFP(Type::tfloat80, ldouble(0));
else
assert(0);
res = DtoAggrPair(DtoType(type), c, c);
@ -1879,7 +1879,7 @@ DValue* PostExp::toElem(IRState* p)
else if (e1type->isfloating())
{
assert(e2type->isfloating());
LLValue* one = DtoConstFP(e1type, 1.0);
LLValue* one = DtoConstFP(e1type, ldouble(1.0));
if (op == TOKplusplus) {
post = llvm::BinaryOperator::CreateFAdd(val,one,"tmp",p->scopebb());
}