Skip to content

Commit

Permalink
attempt #3 to fix mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
jK committed Jun 6, 2011
1 parent 3cb994f commit 03c0f8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rts/lib/streflop/FPUSettings.h
Expand Up @@ -132,9 +132,9 @@ enum FPU_RoundMode {

// plan for portability
#ifdef __APPLE__
#define STREFLOP_FSTCW(cw) do { short tmp; asm volatile ("fstcw %0" : "=m" (tmp) : ); (cw) = tmp; } while (0)
#define STREFLOP_FSTCW(cw) do { short* dest = (short*)&(cw); short tmp; asm volatile ("fstcw %0" : "=m" (tmp) : ); *dest = tmp; } while (0)
#define STREFLOP_FLDCW(cw) do { short tmp = (cw); asm volatile ("fclex \n fldcw %0" : : "m" (tmp) ); } while (0)
#define STREFLOP_STMXCSR(cw) do { int tmp; asm volatile ("stmxcsr %0" : "=m" (tmp) : ); (cw) = tmp; } while (0)
#define STREFLOP_STMXCSR(cw) do { int* dest = (int*)&(cw); int tmp; asm volatile ("stmxcsr %0" : "=m" (tmp) : ); *dest = tmp; } while (0)
#define STREFLOP_LDMXCSR(cw) do { int tmp = (cw); asm volatile ("ldmxcsr %0" : : "m" (tmp) ); } while (0)
#elif defined(_MSC_VER)
#define STREFLOP_FSTCW(cw) do { short tmp; __asm { fstcw tmp }; (cw) = tmp; } while (0)
Expand Down

0 comments on commit 03c0f8f

Please sign in to comment.