Use W32API.

svn path=/trunk/; revision=15949
This commit is contained in:
Filip Navara 2005-06-17 07:59:43 +00:00
parent d4e71ef096
commit 3814e88279
10 changed files with 16 additions and 14 deletions

View file

@ -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;

View file

@ -32,7 +32,6 @@
/* We have always jsconfig.h */
#include <jsconfig.h>
#include "ddk/exfuncs.h"
#include <stdio.h>
#include <assert.h>

View file

@ -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>

View file

@ -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 ) {

View file

@ -30,7 +30,6 @@
#include "js.h"
#include "jsint.h"
#include "kjs.h"
#include "ddk/kefuncs.h"
/*
* Types and definitions.
@ -226,7 +225,7 @@ js_create_interp (JSInterpOptions *options, PKJS kjs)
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 @@ js_create_interp (JSInterpOptions *options, PKJS kjs)
/* 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;

View file

@ -28,7 +28,6 @@
*/
#include "jsconfig.h"
#include "ddk/exfuncs.h"
#define js_malloc(x) ExAllocatePool(NonPagedPool,x)
#define js_free(x) ExFreePool(x)

View file

@ -72,10 +72,6 @@ extern void js_free( void * );
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 @@ init_syntax_once ()
# 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

View file

@ -74,6 +74,7 @@ f->code[cpos++].u.ptr = (a)
#define DONE() goto done
#undef ERROR
#define ERROR(msg) \
do { \
JS_SAVE_REGS (); \

View file

@ -54,6 +54,7 @@ f->code[cpos++].u.op = (a)
#define DONE() goto done
#undef ERROR
#define ERROR(msg) \
do { \
JS_SAVE_REGS (); \

View file

@ -272,6 +272,7 @@ link_code (JSVirtualMachine *vm, unsigned char *code, unsigned int code_len,
#define DONE() goto done
#undef ERROR
#define ERROR(msg) \
do { \
JS_SAVE_REGS (); \