diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-05-22 15:05:32 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-05-22 15:05:32 -0400 |
commit | 851655fc9c7f9316c33912031a1aa4eecb1360c6 (patch) | |
tree | ebdcc296a4d39ede781db6ffa411d95a58253f5b | |
parent | 5eb08a4478427875598d6b93d96e07da3a38a9c4 (diff) | |
parent | 53ae7f47fe7be655ffc1806f0ea3d30b31c79180 (diff) | |
download | mongo-851655fc9c7f9316c33912031a1aa4eecb1360c6.tar.gz |
Merge branch 'master' of git@github.com:mongodb/mongo
-rw-r--r-- | SConstruct | 24 | ||||
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 7 |
2 files changed, 21 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct index 14afc4fd944..08bf7fc07fa 100644 --- a/SConstruct +++ b/SConstruct @@ -325,27 +325,35 @@ elif "win32" == os.sys.platform: boostLibs = [] - javaHome = findVersion( "C:/Program Files/java/" , - [ "jdk" , "jdk1.6.0_10" ] ) + if usesm: + env.Append( CPPPATH=[ "js/src/" ] ) + env.Append( CPPDEFINES=[ "OLDJS" ] ) + else: + javaHome = findVersion( "C:/Program Files/java/" , + [ "jdk" , "jdk1.6.0_10" ] ) + env.Append( CPPPATH=[ javaHome + "/include" , javaHome + "/include/win32" ] ) + env.Append( LIBPATH=[ javaHome + "/Lib" ] ) + javaLibs += [ "jvm" ]; + winSDKHome = findVersion( "C:/Program Files/Microsoft SDKs/Windows/" , [ "v6.0" , "v6.0a" , "v6.1" ] ) - env.Append( CPPPATH=[ boostDir , javaHome + "/include" , javaHome + "/include/win32" , "pcre-7.4" , winSDKHome + "/Include" ] ) + env.Append( CPPPATH=[ boostDir , "pcre-7.4" , winSDKHome + "/Include" ] ) env.Append( CPPFLAGS=" /EHsc /W3 " ) env.Append( CPPDEFINES=["WIN32","_CONSOLE","_CRT_SECURE_NO_WARNINGS","HAVE_CONFIG_H","PCRE_STATIC","_UNICODE","UNICODE" ] ) + #env.Append( CPPFLAGS=' /Yu"stdafx.h" ' ) # this would be for pre-compiled headers, could play with it later + if release: env.Append( CPPDEFINES=[ "NDEBUG" ] ) env.Append( CPPFLAGS= " /O2 /Oi /GL /FD /MT /Gy /nologo /Zi /TP /errorReport:prompt /Gm " ) - # /Yu"stdafx.h" /Fp"Release\db.pch" /Fo"Release\\" /Fd"Release\vc90.pdb" else: env.Append( CPPDEFINES=[ "_DEBUG" ] ) env.Append( CPPFLAGS=" /Od /Gm /RTC1 /MDd /ZI " ) - # /Fo"Debug\\" /Fd"Debug\vc90.pdb" + env.Append( CPPFLAGS=' /Fd"mongod.pdb" ' ) - env.Append( LIBPATH=[ boostDir + "/Lib" , javaHome + "/Lib" , winSDKHome + "/Lib" ] ) - javaLibs += [ "jvm" ]; + env.Append( LIBPATH=[ boostDir + "/Lib" , winSDKHome + "/Lib" ] ) def pcreFilter(x): name = x.name @@ -483,7 +491,7 @@ def doConfigure( myenv , needJava=True , needPcre=True , shell=False ): return True - if release and not java and failIfNotFound: + if release and not java and not windows and failIfNotFound: extra = "" if linux64 and shell: extra += " 32 bit version for shell" diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index 13fd44845f4..8f809fb12e6 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -84,10 +84,13 @@ namespace mongo { if( srclen == 0 ) return ""; - size_t len = srclen * 2; + size_t len = srclen * 4; char * dst = (char*)malloc( len ); - assert( JS_EncodeCharacters( _context , s , srclen , dst , &len) ); + len /= 2; // weird JS_EncodeCharacters api expects len in 16bit units but modifies it to represent size in 8bit units. + + assert( JS_EncodeCharacters( _context , s , srclen , dst , &len) ); + string ss( dst , len ); free( dst ); return ss; |