Use W32API.
Modified: trunk/reactos/lib/kjs/include/jsconfig.h
Modified: trunk/reactos/lib/kjs/include/jsint.h
Modified: trunk/reactos/lib/kjs/kjs.xml
Modified: trunk/reactos/lib/kjs/ksrc/compat.c
Modified: trunk/reactos/lib/kjs/ksrc/js.c
Modified: trunk/reactos/lib/kjs/ksrc/mrgsort.c
Modified: trunk/reactos/lib/kjs/ksrc/regex.c
Modified: trunk/reactos/lib/kjs/ksrc/vmjumps.c
Modified: trunk/reactos/lib/kjs/ksrc/vmswitch.c
Modified: trunk/reactos/lib/kjs/ksrc/vmswt0.c

Modified: trunk/reactos/lib/kjs/include/jsconfig.h
--- trunk/reactos/lib/kjs/include/jsconfig.h	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/include/jsconfig.h	2005-06-17 07:59:43 UTC (rev 15949)
@@ -168,7 +168,6 @@
 #define HAVE_UNISTD_H 1
 
 #include "ddk/ntddk.h"
-#include "ntos/rtl.h"
 /* #include "assert.h" */
 #ifndef __TYPE_UINT64
 typedef unsigned __int64 __uint64;

Modified: trunk/reactos/lib/kjs/include/jsint.h
--- trunk/reactos/lib/kjs/include/jsint.h	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/include/jsint.h	2005-06-17 07:59:43 UTC (rev 15949)
@@ -32,7 +32,6 @@
 
 /* We have always jsconfig.h */
 #include <jsconfig.h>
-#include "ddk/exfuncs.h"
 
 #include <stdio.h>
 #include <assert.h>

Modified: trunk/reactos/lib/kjs/kjs.xml
--- trunk/reactos/lib/kjs/kjs.xml	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/kjs.xml	2005-06-17 07:59:43 UTC (rev 15949)
@@ -3,6 +3,8 @@
 	<include base="kjs">src</include>
 	<include base="kjs">include</include>
 	<define name="__NO_CTYPE_INLINES" />
+	<define name="__USE_W32API" />
+	<define name="_NTOSKRNL_" />
 	<directory name="ksrc">
 		<file>setjmp.S</file>
 		<file>longjmp.S</file>

Modified: trunk/reactos/lib/kjs/ksrc/compat.c
--- trunk/reactos/lib/kjs/ksrc/compat.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/compat.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -1,10 +1,10 @@
 #include "ddk/ntddk.h"
-#include "ddk/kefuncs.h"
 #include "ctype.h"
 #include "jsconfig.h"
 
 void __kernel_abort() {
-  KEBUGCHECK(0);
+  DbgPrint("KeBugCheck (0x%X) at %s:%i\n", 0, __FILE__,__LINE__);
+  KeBugCheck(0);
 }
 
 void _assert( const char *expr, const char *file, int line ) {

Modified: trunk/reactos/lib/kjs/ksrc/js.c
--- trunk/reactos/lib/kjs/ksrc/js.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/js.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -30,7 +30,6 @@
 #include "js.h"
 #include "jsint.h"
 #include "kjs.h"
-#include "ddk/kefuncs.h"
 
 /*
  * Types and definitions.
@@ -226,7 +225,7 @@
 			     options->stacktrace_on_error,
 			     s_stdin, s_stdout, s_stderr);
   if (interp->vm == NULL)
-    KEBUGCHECK(0);
+    __kernel_abort();
 
   /* Set some options. */
   interp->vm->warn_undef = options->warn_undef;
@@ -253,17 +252,17 @@
       /* Define compiler to the virtual machine. */
       bc = js_bc_read_data (js_compiler_bytecode, js_compiler_bytecode_len);
       if (bc == NULL)
-	KEBUGCHECK(0);
+	__kernel_abort();
 
       result = js_vm_execute (interp->vm, bc);
       js_bc_free (bc);
       if (!result)
-	KEBUGCHECK(0);
+	__kernel_abort();
     }
 
   /* Initialize our extensions. */
   if (!js_define_module (interp, js_core_globals))
-    KEBUGCHECK(0);
+    __kernel_abort();
 
   /* Ok, we'r done. */
   return interp;

Modified: trunk/reactos/lib/kjs/ksrc/mrgsort.c
--- trunk/reactos/lib/kjs/ksrc/mrgsort.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/mrgsort.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -28,7 +28,6 @@
  */
 
 #include "jsconfig.h"
-#include "ddk/exfuncs.h"
 #define js_malloc(x) ExAllocatePool(NonPagedPool,x)
 #define js_free(x) ExFreePool(x)
 

Modified: trunk/reactos/lib/kjs/ksrc/regex.c
--- trunk/reactos/lib/kjs/ksrc/regex.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/regex.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -72,10 +72,6 @@
 extern void *js_realloc( void *, int );
 extern void *js_malloc( int );
 
-#define realloc js_realloc
-#define malloc js_malloc
-#define free js_free
-
 #ifdef _LIBC
 /* We have to keep the namespace clean.  */
 # define regfree(preg) __regfree (preg)
@@ -320,6 +316,11 @@
 # define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
 #endif
 
+
+#define realloc js_realloc
+#define malloc js_malloc
+#define free js_free
+
 /* Should we use malloc or alloca?  If REGEX_MALLOC is not defined, we
    use `alloca' instead of `malloc'.  This is because using malloc in
    re_search* or re_match* could cause memory leaks when C-g is used in

Modified: trunk/reactos/lib/kjs/ksrc/vmjumps.c
--- trunk/reactos/lib/kjs/ksrc/vmjumps.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/vmjumps.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -74,6 +74,7 @@
 
 #define DONE() goto done
 
+#undef ERROR
 #define ERROR(msg)		\
   do {				\
     JS_SAVE_REGS ();		\

Modified: trunk/reactos/lib/kjs/ksrc/vmswitch.c
--- trunk/reactos/lib/kjs/ksrc/vmswitch.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/vmswitch.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -54,6 +54,7 @@
 
 #define DONE() goto done
 
+#undef ERROR
 #define ERROR(msg)		\
   do {				\
     JS_SAVE_REGS ();		\

Modified: trunk/reactos/lib/kjs/ksrc/vmswt0.c
--- trunk/reactos/lib/kjs/ksrc/vmswt0.c	2005-06-17 07:57:37 UTC (rev 15948)
+++ trunk/reactos/lib/kjs/ksrc/vmswt0.c	2005-06-17 07:59:43 UTC (rev 15949)
@@ -272,6 +272,7 @@
 
 #define DONE() goto done
 
+#undef ERROR
 #define ERROR(msg)		\
   do {				\
     JS_SAVE_REGS ();		\