I'm embedding OSSP js in a project and I found the following problems:
JS_REMOVE_LINK(&sfp->links);
causes a segfault because sfp is NULL. I didn't have the time or inclination to investigate this, but adding:
if(! sfp) break;
before that statement eliminated the crash.
According to the SpiderMonkey team:
"I don't know what version OSSP is using, but this sounds like bug 345350 (https://bugzilla.mozilla.org/show_bug.cgi?id=345350). Your patch just detects this in the loop, but that adds an if test to every iteration that runs when the table has not been finished. The patch in bug 345350 tests before the loop."
a. prjmtime.c fails to compile because the two #include statements at line 61 are not sufficient; I got lots of errors about LPCONTEXT and such being undefined. I replaced these with a single "#include <windows.h >" to solve the problem.
b. I copied config.h.in to config.h and added the following at the bottom:
#define __VA_COPY_USE __VA_COPY_USE_CPP
But this caused compiler errors because the #define of that macro has a typo: one of the close parens is in the wrong place. It should be: #define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void )(s), sizeof((s)))
It looks like __VA_COPY_USE_CPS has the same problem.
c. The following macros have to be defined globally for the project to eliminate the hundreds of VC++ compiler warnings I got. This should be documented in a README or somewhere:
XP_WIN
OSSP
EXPORT_JS_API
_CRT_SECURE_NO_DEPRECATE
_USE_32BIT_TIME_T
Also I had to turn off the "Detect 64-bit Portability Issues" option (no /Wp64 switch to the compiler).
I will happily contribute my Visual Studio 2005 Solution and Project files if you're willing to add them to the OSSP js distro (it's just 3 small XML files).