Bug 462912 - THIS is defined on windows mobile r=jim
--- a/js/src/js.cpp
+++ b/js/src/js.cpp
@@ -246,16 +246,18 @@ Process(JSContext *cx, JSObject *obj, ch
JSSMSG_CANT_OPEN, filename, strerror(errno));
gExitCode = EXITCODE_FILE_NOT_FOUND;
return;
}
}
SetContextOptions(cx);
+#ifndef WINCE
+ /* windows mobile (and possibly other os's) does not have a TTY */
if (!forceTTY && !isatty(fileno(file))) {
/*
* It's not interactive - just execute it.
*
* Support the UNIX #! shell hack; gobble the first line if it starts
* with '#'. TODO - this isn't quite compatible with sharp variables,
* as a legal js program (using sharp variables) might start with '#'.
* But that would require multi-character lookahead.
@@ -278,16 +280,17 @@ Process(JSContext *cx, JSObject *obj, ch
(void)JS_ExecuteScript(cx, obj, script, NULL);
JS_DestroyScript(cx, script);
}
if (file != stdin)
fclose(file);
return;
}
+#endif /* WINCE */
/* It's an interactive filehandle; drop into read-eval-print loop. */
lineno = 1;
hitEOF = JS_FALSE;
do {
bufp = buffer;
*bufp = '\0';
@@ -3961,18 +3964,19 @@ main(int argc, char **argv, char **envp)
JSDJContext *jsdjc;
#endif
#ifdef JSDEBUGGER_C_UI
JSBool jsdbc;
#endif /* JSDEBUGGER_C_UI */
#endif /* JSDEBUGGER */
CheckHelpMessages();
+#ifndef WINCE
setlocale(LC_ALL, "");
-
+#endif
gStackBase = (jsuword)&stackDummy;
#ifdef XP_OS2
/* these streams are normally line buffered on OS/2 and need a \n, *
* so we need to unbuffer then to get a reasonable prompt */
setbuf(stdout,0);
setbuf(stderr,0);
#endif
--- a/js/src/jsbuiltins.h
+++ b/js/src/jsbuiltins.h
@@ -40,16 +40,20 @@
#ifndef jsbuiltins_h___
#define jsbuiltins_h___
#ifdef JS_TRACER
#include "nanojit/nanojit.h"
#include "jstracer.h"
+#ifdef THIS
+#undef THIS
+#endif
+
enum JSTNErrType { INFALLIBLE, FAIL_NULL, FAIL_NEG, FAIL_VOID, FAIL_JSVAL };
enum { JSTN_ERRTYPE_MASK = 7, JSTN_MORE = 8 };
#define JSTN_ERRTYPE(jstn) ((jstn)->flags & JSTN_ERRTYPE_MASK)
/*
* |prefix| and |argtypes| declare what arguments should be passed to the
* native function. |prefix| can contain the following characters: