Index: /trunk/src/kash/Makefile.kmk
===================================================================
--- /trunk/src/kash/Makefile.kmk	(revision 2313)
+++ /trunk/src/kash/Makefile.kmk	(revision 2314)
@@ -57,5 +57,5 @@
 kash_CFLAGS += -std=gnu99
 endif
-kash_CFLAGS.win = -GS-
+kash_CFLAGS.win.amd64 = -GS-
 kash_SOURCES = \
 	main.c \
Index: /trunk/src/kash/shforkA-win.asm
===================================================================
--- /trunk/src/kash/shforkA-win.asm	(revision 2313)
+++ /trunk/src/kash/shforkA-win.asm	(revision 2314)
@@ -131,7 +131,7 @@
         mov     [eax - 10h], edx
         mov     [eax - 18h], ecx
-        cmp     rax, edx
+        cmp     eax, edx
         jb      .below
-        mov     [fs:04h], rax
+        mov     [fs:04h], eax
 .below:
         lea     edx, [eax - SHFORK_STACK_SIZE]
Index: /trunk/src/kash/shtypes.h
===================================================================
--- /trunk/src/kash/shtypes.h	(revision 2313)
+++ /trunk/src/kash/shtypes.h	(revision 2314)
@@ -37,5 +37,4 @@
 
 #ifdef _MSC_VER
-# include <io.h> /* intptr_t and uintptr_t */
 typedef signed char     int8_t;
 typedef unsigned char   uint8_t;
@@ -46,4 +45,10 @@
 typedef _int64          int64_t;
 typedef unsigned _int64 uint64_t;
+# if _MSC_VER >= 1400
+#  include <io.h> /* intptr_t and uintptr_t */
+# else
+typedef KIPTR           intptr_t;
+typedef KUPTR           uintptr_t;
+# endif
 
 #define INT16_C(c)      (c)
Index: /trunk/src/kash/syntax.h
===================================================================
--- /trunk/src/kash/syntax.h	(revision 2313)
+++ /trunk/src/kash/syntax.h	(revision 2314)
@@ -34,4 +34,5 @@
 
 #include <ctype.h>
+#include <limits.h>
 
 /* Syntax classes */
