diff --git a/js/src/jstracer.h b/js/src/jstracer.h index cacacbc51559..91288fe2eb99 100755 --- a/js/src/jstracer.h +++ b/js/src/jstracer.h @@ -202,7 +202,7 @@ public: void clear(); }; -#if defined(JS_JIT_SPEW) || defined(MOZ_NO_VARADIC_MACROS) +#if defined(JS_JIT_SPEW) || defined(NJ_NO_VARIADIC_MACROS) enum LC_TMBits { /* @@ -220,7 +220,7 @@ enum LC_TMBits { #endif -#ifdef MOZ_NO_VARADIC_MACROS +#ifdef NJ_NO_VARIADIC_MACROS #define debug_only_stmt(action) /* */ static void debug_only_printf(int mask, const char *fmt, ...) {} diff --git a/js/src/jstypes.h b/js/src/jstypes.h index 17183e24c5f6..f6b49f49d65b 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -296,7 +296,7 @@ #ifdef _MSC_VER # include "jscpucfg.h" /* We can't auto-detect MSVC configuration */ # if _MSC_VER < 1400 -# define MOZ_NO_VARADIC_MACROS +# define NJ_NO_VARIADIC_MACROS # endif #else # include "jsautocfg.h" /* Use auto-detected configuration */ diff --git a/js/src/nanojit/Native.h b/js/src/nanojit/Native.h index e7d1019babe4..cf21f621fb4a 100644 --- a/js/src/nanojit/Native.h +++ b/js/src/nanojit/Native.h @@ -110,7 +110,7 @@ namespace nanojit { #define isSPorFP(r) ( (r)==SP || (r)==FP ) - #ifdef MOZ_NO_VARADIC_MACROS + #ifdef NJ_NO_VARIADIC_MACROS static void asm_output(const char *f, ...) {} #define gpn(r) regNames[(r)] #define fpn(r) regNames[(r)] diff --git a/js/src/nanojit/VMPI.h b/js/src/nanojit/VMPI.h index 5d8d3808e8e5..83353623f6eb 100644 --- a/js/src/nanojit/VMPI.h +++ b/js/src/nanojit/VMPI.h @@ -56,6 +56,7 @@ #include #include #include +#include #if defined(AVMPLUS_UNIX) || defined(AVMPLUS_OS2) #include @@ -84,6 +85,7 @@ typedef unsigned __int64 uint64_t; #define VMPI_strncat strncat #define VMPI_strcpy strcpy #define VMPI_sprintf sprintf +#define VMPI_vfprintf vfprintf #define VMPI_memset memset #define VMPI_isdigit isdigit #define VMPI_getDate() diff --git a/js/src/nanojit/avmplus.cpp b/js/src/nanojit/avmplus.cpp index c292bce99ba4..aa26b64d85fd 100644 --- a/js/src/nanojit/avmplus.cpp +++ b/js/src/nanojit/avmplus.cpp @@ -51,6 +51,10 @@ Config AvmCore::config; void avmplus::AvmLog(char const *msg, ...) { + va_list ap; + va_start(ap, msg); + VMPI_vfprintf(stderr, msg, ap); + va_end(ap); } #ifdef _DEBUG diff --git a/js/src/nanojit/avmplus.h b/js/src/nanojit/avmplus.h index a383675dd84e..def8ac6ed465 100644 --- a/js/src/nanojit/avmplus.h +++ b/js/src/nanojit/avmplus.h @@ -85,7 +85,7 @@ static inline bool blx_lr_broken() { #include #endif -#if defined(DEBUG) || defined(MOZ_NO_VARADIC_MACROS) +#if defined(DEBUG) || defined(NJ_NO_VARIADIC_MACROS) #if !defined _DEBUG #define _DEBUG #endif diff --git a/js/src/nanojit/nanojit.h b/js/src/nanojit/nanojit.h index e33bb4a9fc77..9190e9561196 100644 --- a/js/src/nanojit/nanojit.h +++ b/js/src/nanojit/nanojit.h @@ -91,15 +91,15 @@ namespace nanojit const uint32_t MAXARGS = 8; - #ifdef MOZ_NO_VARADIC_MACROS - static void NanoAssertMsgf(bool a,const char *f,...) {} - static void NanoAssertMsg(bool a,const char *m) {} - static void NanoAssert(bool a) {} + #ifdef NJ_NO_VARIADIC_MACROS + inline void NanoAssertMsgf(bool a,const char *f,...) {} + inline void NanoAssertMsg(bool a,const char *m) {} + inline void NanoAssert(bool a) {} #elif defined(_DEBUG) #define __NanoAssertMsgf(a, file_, line_, f, ...) \ if (!(a)) { \ - fprintf(stderr, "Assertion failed: " f "%s (%s:%d)\n", __VA_ARGS__, #a, file_, line_); \ + avmplus::AvmLog("Assertion failed: " f "%s (%s:%d)\n", __VA_ARGS__, #a, file_, line_); \ NanoAssertFail(); \ } @@ -144,7 +144,7 @@ namespace nanojit #endif #endif -#ifdef MOZ_NO_VARADIC_MACROS +#ifdef NJ_NO_VARIADIC_MACROS #include #define verbose_outputf if (_logc->lcbits & LC_Assembly) \ Assembler::outputf