mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
windows fix
This commit is contained in:
parent
c534b26997
commit
36134dafaf
14
SConstruct
14
SConstruct
@ -1091,6 +1091,12 @@ def jsToH(target, source, env):
|
||||
,'namespace JSFiles{'
|
||||
]
|
||||
|
||||
def cppEscape(s):
|
||||
s = s.strip()
|
||||
s = s.replace( '\\' , '\\\\' )
|
||||
s = s.replace( '"' , r'\"' )
|
||||
return s
|
||||
|
||||
for s in source:
|
||||
filename = str(s)
|
||||
objname = os.path.split(filename)[1].split('.')[0]
|
||||
@ -1099,15 +1105,11 @@ def jsToH(target, source, env):
|
||||
h.append('const StringData ' + stringname + " = ")
|
||||
|
||||
for l in open( filename , 'r' ):
|
||||
l = l.strip()
|
||||
l = l.replace( '\\' , '\\\\' )
|
||||
l = l.replace( '"' , r'\"' )
|
||||
|
||||
h.append( '"' + l + r'\n" ' )
|
||||
h.append( '"' + cppEscape(l) + r'\n" ' )
|
||||
|
||||
h.append(";")
|
||||
h.append('extern const JSFile %s;'%objname) #symbols aren't exported w/o this
|
||||
h.append('const JSFile %s = { "%s" , %s };'%(objname, filename, stringname))
|
||||
h.append('const JSFile %s = { "%s" , %s };'%(objname, cppEscape(filename), stringname))
|
||||
|
||||
h.append("} // namespace JSFiles")
|
||||
h.append("} // namespace mongo")
|
||||
|
@ -3051,4 +3051,4 @@ const StringData _jscode_raw_collection =
|
||||
extern const JSFile collection;
|
||||
const JSFile collection = { "shell/collection.js" , _jscode_raw_collection };
|
||||
} // namespace JSFiles
|
||||
} // namespace mongo
|
||||
} // namespace mongo
|
||||
|
Loading…
Reference in New Issue
Block a user