]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Fix build with MS cl on windows and some ANSI C issues.
authorKlaus Treichel <ktreichel@web.de>
Fri, 23 May 2008 11:00:42 +0000 (11:00 +0000)
committerKlaus Treichel <ktreichel@web.de>
Fri, 23 May 2008 11:00:42 +0000 (11:00 +0000)
ChangeLog
dpas/dpas-scanner.l
include/jit/jit-arch-x86-64.h
include/jit/jit-arch-x86.h
jit/jit-rules-x86.ins
tools/gen-rules-scanner.l
tools/gen-sel-scanner.l

index 2280d3006f2de7ce83a903d3b8882ea34510e6b0..c50b998539292c51e765a89e653eb0f14e56670f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-05-23  Klaus Treichel   <ktreichel@web.de>
+
+       * dpas/dpas-scanner.l, tools/gen-rules-scanner.l,
+       tools/gen-sel-scanner.l: Define YY_NO_UNISTD_H if unistd.h is not
+       available to prevent flex from including unistd.h.
+
+       * include/jit/jit-arch-x86.h, include/jit/jit-arch-x86.h: Fix the
+        definition of _JIT_ARCH_GET_CURRENT_FRAME for MS cl. Use a
+       temporary value for ebp/rbp because cl doesn't like arguments like
+       f->x in the __asm statements.
+
+       * jit/jit-rules-x86.ins: Move declaration of patch to the start of
+       the block in JIT_OP_ULONG_TO_NFLOAT to be ANSI C compliant.
+
 2008-05-21  Aleksey Demakov  <ademakov@gmail.com>
 
        * include/jit/jit-walk.h (jit_get_next_frame_address): use
index 952b80247bde9492c3d47de2ed2363b038e0d66d..5755889cd132b65c5aae2f5afeef17a9fc829af4 100644 (file)
 
 #include "dpas-internal.h"
 #include "dpas-parser.h"
+#include <config.h>
+#ifndef HAVE_UNISTD_H
+       #define YY_NO_UNISTD_H
+#endif
 
 extern YYSTYPE yylval;
 
index 6d506f0be4e5aa492d3c5974746b57833dbfe45f..5d647b06fe4fae643da2fcdd414519b33988f982 100644 (file)
@@ -44,10 +44,12 @@ struct _jit_arch_frame
 #elif defined(_MSC_VER) && defined(_M_IX86)
 #define        _JIT_ARCH_GET_CURRENT_FRAME(f)          \
        do {                                    \
+               void *__ptr;                    \
                __asm                           \
                {                               \
-                       mov qword ptr f, rbp    \
+                       __asm mov qword ptr __ptr, rbp  \
                }                               \
+               (f) = __ptr;                    \
        } while(0)
 #else
 #undef _JIT_ARCH_GET_CURRENT_FRAME
index e4f285ed4d2d7f5c28e6e73870b5ed6aa852ee01..12848a9334f8179214792a0c4b53939c9d67e6c9 100644 (file)
 #elif defined(_MSC_VER) && defined(_M_IX86)
 #define        _JIT_ARCH_GET_CURRENT_FRAME(f)          \
        do {                                    \
+               void *__ptr;                    \
                __asm                           \
                {                               \
-                       mov dword ptr f, ebp    \
+                       __asm mov dword ptr __ptr, ebp  \
                }                               \
+               (f) = __ptr;                    \
        } while(0)
 #else
 #undef _JIT_ARCH_GET_CURRENT_FRAME
index b1dfef3c288c4351c43b52620d818ec0c2a1bee0..44bfe0d92f615669828465d01983a5ea6c1368a1 100644 (file)
@@ -221,12 +221,12 @@ JIT_OP_ULONG_TO_NFLOAT: more_space
                /* TODO: review wrt relocation for elf pre-compilation */
                static float f2pow64;
                static int inited;
+               unsigned char *patch;
                if(!inited)
                {
                        f2pow64 = jit_float32_pow(2.0, 64);
                        inited = 1;
                }
-               unsigned char *patch;
                x86_push_reg(inst, %2);
                x86_push_reg(inst, $2);
                x86_fild_membase(inst, X86_ESP, 0, 1);
index 4360ec246748cc61b2e3add79842be09b21adcdb..b747787eb53b42211d9161304408f38b80774a37 100644 (file)
@@ -32,6 +32,9 @@
 #ifdef HAVE_STDLIB_H
        #include <stdlib.h>
 #endif
+#ifndef HAVE_UNISTD_H
+       #define YY_NO_UNISTD_H
+#endif
 
 extern YYSTYPE yylval;
 
index 2dc9a3338d6a4a6f7a1929931526a961901c4fa6..0759e02738dccab7dab5bf0409af6f1293d3a9c1 100644 (file)
@@ -32,6 +32,9 @@
 #ifdef HAVE_STDLIB_H
        #include <stdlib.h>
 #endif
+#ifndef HAVE_UNISTD_H
+       #define YY_NO_UNISTD_H
+#endif
 
 extern YYSTYPE yylval;