From 34b0362129ada5ca743cfb659f55fe133362bede Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 9 Oct 2009 12:58:39 -0700 Subject: [PATCH] Bug 521340 - TM merge: more build infrastructure (tracemonkey side), r=nnethercote. --- js/src/lirasm/lirasm.cpp | 14 +++++++++++--- js/src/nanojit/VMPI.h | 4 ++++ js/src/nanojit/avmplus.h | 4 ---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/js/src/lirasm/lirasm.cpp b/js/src/lirasm/lirasm.cpp index f1cd5dd65635..71f8050c2059 100644 --- a/js/src/lirasm/lirasm.cpp +++ b/js/src/lirasm/lirasm.cpp @@ -113,9 +113,9 @@ nanojit::LirNameMap::formatGuard(LIns *i, char *out) } #endif -typedef FASTCALL int32_t (*RetInt)(); -typedef FASTCALL double (*RetFloat)(); -typedef FASTCALL GuardRecord* (*RetGuard)(); +typedef int32_t (FASTCALL *RetInt)(); +typedef double (FASTCALL *RetFloat)(); +typedef GuardRecord* (FASTCALL *RetGuard)(); struct Function { const char *name; @@ -325,6 +325,14 @@ private: void endFragment(); }; +// 'sin' is overloaded on some platforms, so taking its address +// doesn't quite work. Provide a do-nothing function here +// that's not overloaded. +double sinFn(double d) { + return sin(d); +} +#define sin sinFn + Function functions[] = { FN(puts, I32 | (PTRARG<<2)), FN(sin, F64 | (F64<<2)), diff --git a/js/src/nanojit/VMPI.h b/js/src/nanojit/VMPI.h index ac70633aee86..5d8d3808e8e5 100644 --- a/js/src/nanojit/VMPI.h +++ b/js/src/nanojit/VMPI.h @@ -46,6 +46,10 @@ #ifndef __VMPI_h__ #define __VMPI_h__ +#if defined(HAVE_CONFIG_H) && defined(NANOJIT_CENTRAL) +#include "config.h" +#endif + #include #include #include diff --git a/js/src/nanojit/avmplus.h b/js/src/nanojit/avmplus.h index b83e8284bb4c..f63796435f37 100644 --- a/js/src/nanojit/avmplus.h +++ b/js/src/nanojit/avmplus.h @@ -36,10 +36,6 @@ #ifndef avm_h___ #define avm_h___ -#if defined(HAVE_CONFIG_H) && defined(NANOJIT_CENTRAL) -#include "config.h" -#endif - #include "VMPI.h" #if !defined(AVMPLUS_LITTLE_ENDIAN) && !defined(AVMPLUS_BIG_ENDIAN)