Skip to content

Commit

Permalink
Merge e0a3e1f into 649f3f1
Browse files Browse the repository at this point in the history
  • Loading branch information
bencoman committed Dec 1, 2018
2 parents 649f3f1 + e0a3e1f commit f77ae53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions platforms/Cross/plugins/IA32ABI/x64win64abicc.c
Expand Up @@ -38,6 +38,9 @@ extern
#endif
struct VirtualMachine* interpreterProxy;

#ifdef _MSC_VER
# define alloca _alloca
#endif
#if __GNUC__
# define setsp(sp) __asm__ volatile ("movq %0,%%rsp" : : "m"(sp))
# define getsp() ({ void *sp; __asm__ volatile ("movq %%rsp,%0" : "=r"(sp) : ); sp;})
Expand Down
6 changes: 4 additions & 2 deletions platforms/minheadless/windows/sqPlatformSpecific-Win32.c
Expand Up @@ -116,7 +116,8 @@ void
ioInitPlatformSpecific(void)
{
/* Setup the FPU */
_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC);
// x64 does not support _MCW_PC or _MCW_IC (https://msdn.microsoft.com/en-us/library/e9b52ceh.aspx)
_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC );

/* Create the wake up event. */
vmWakeUpEvent = CreateEvent(NULL, 1, 0, NULL);
Expand Down Expand Up @@ -364,7 +365,8 @@ static LONG CALLBACK squeakExceptionHandler(LPEXCEPTION_POINTERS exp)
if((code >= EXCEPTION_FLT_DENORMAL_OPERAND) && (code <= EXCEPTION_FLT_UNDERFLOW))
{
/* turn on the default masking of exceptions in the FPU and proceed */
_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC);
// x64 does not support _MCW_PC or _MCW_IC (https://msdn.microsoft.com/en-us/library/e9b52ceh.aspx)
_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC );
result = EXCEPTION_CONTINUE_EXECUTION;
}
}
Expand Down
4 changes: 2 additions & 2 deletions platforms/minheadless/windows/sqPlatformSpecific-Win32.h
Expand Up @@ -114,7 +114,7 @@ size_t sqImageFileWrite(const void *ptr, size_t sz, size_t count, sqImageFile h)
error "Not Win32!"
#endif /* WIN32 */

int ioSetCursorARGB(sqInt bitsIndex, sqInt w, sqInt h, sqInt x, sqInt y);
sqInt ioSetCursorARGB(sqInt bitsIndex, sqInt w, sqInt h, sqInt x, sqInt y);

/* poll and profile thread priorities. The stack vm uses a thread to cause the
* VM to poll for I/O, check for delay expiry et al at regular intervals. Both
Expand Down Expand Up @@ -185,4 +185,4 @@ extern const unsigned long tltiIndex;
#define TRY
#define EXCEPT(filter) if (0)
#define FINALLY
#endif
#endif

0 comments on commit f77ae53

Please sign in to comment.