diff options
Diffstat (limited to 'deno2/file_util.cc')
-rw-r--r-- | deno2/file_util.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/deno2/file_util.cc b/deno2/file_util.cc index c78d3e227..20711bae7 100644 --- a/deno2/file_util.cc +++ b/deno2/file_util.cc @@ -44,16 +44,18 @@ class StartupDataCppWriter { void WritePrefix() { file_ << "// Autogenerated snapshot file. Do not edit.\n\n"; file_ << "#include \"v8/include/v8.h\"\n\n"; + file_ << "namespace deno { \n\n"; } void WriteSuffix() { char buffer[500]; - snprintf(buffer, sizeof(buffer), - "const v8::StartupData* StartupBlob_%s() {\n", name_); + snprintf(buffer, sizeof(buffer), "v8::StartupData* StartupBlob_%s() {\n", + name_); file_ << buffer; snprintf(buffer, sizeof(buffer), " return &%s_blob;\n", name_); file_ << buffer; file_ << "}\n\n"; + file_ << "} // namespace deno\n\n"; } void WriteBinaryContentsAsCArray() { @@ -78,7 +80,7 @@ class StartupDataCppWriter { snprintf(buffer, sizeof(buffer), "static const int %s_blob_size = %llu;\n", name_, static_cast<unsigned long long>(data_.size())); file_ << buffer; - snprintf(buffer, sizeof(buffer), "static const v8::StartupData %s_blob =\n", + snprintf(buffer, sizeof(buffer), "static v8::StartupData %s_blob =\n", name_); file_ << buffer; snprintf(buffer, sizeof(buffer), |