aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-14 23:07:55 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-14 23:07:55 -0700
commit9719ae096d358e29a37762047878ce1c9210d5e0 (patch)
treeec8da9f9e63aeff8f3fcd4d68a2ace404d18965a
parent0854188f3cf5c4b9d2af5c623b41f73050426bf7 (diff)
downloadbun-9719ae096d358e29a37762047878ce1c9210d5e0.tar.gz
bun-9719ae096d358e29a37762047878ce1c9210d5e0.tar.zst
bun-9719ae096d358e29a37762047878ce1c9210d5e0.zip
Fix build-generated typo
-rw-r--r--src/javascript/jsc/headergen/sizegen.cpp70
1 files changed, 39 insertions, 31 deletions
diff --git a/src/javascript/jsc/headergen/sizegen.cpp b/src/javascript/jsc/headergen/sizegen.cpp
index ed43810e2..dd6713401 100644
--- a/src/javascript/jsc/headergen/sizegen.cpp
+++ b/src/javascript/jsc/headergen/sizegen.cpp
@@ -1,41 +1,49 @@
-#include <iostream>
+#include <ctime>
#include <fstream>
-#include <ctime>
+#include <iostream>
using namespace std;
#include "headers-cpp.h"
int main() {
- time_t rawtime;
- struct tm * timeinfo;
- char buf [80];
+ time_t rawtime;
+ struct tm *timeinfo;
+ char buf[80];
+
+ time(&rawtime);
+ timeinfo = localtime(&rawtime);
- time (&rawtime);
- timeinfo = localtime (&rawtime);
+ strftime(buf, 80, "%Y-%m-%d %H:%M:%s", timeinfo);
- strftime (buf,80,"%Y-%m-%d %H:%M:%s",timeinfo);
+ cout << "// Auto-generated by src/javascript/jsc/headergen/sizegen.cpp at "
+ << buf << ".\n";
+ cout << "// These are the byte sizes for the different object types with "
+ "bindings in JavaScriptCore.\n";
+ cout << "// This allows us to safely return stack allocated C++ types to "
+ "Zig.\n";
+ cout << "// It is only safe to do this when these sizes are correct.\n";
+ cout << "// That means:\n";
+ cout << "// 1. We can't dynamically link JavaScriptCore\n";
+ cout << "// 2. It's important that this is run whenever JavaScriptCore is "
+ "updated or the bindings on the Zig side change.\n";
+ cout << "// Failure to do so will lead to undefined behavior and probably "
+ "some frustrated people.\n";
+ cout << "// --- Regenerate this: --- \n";
+ cout << "// 1. \"make jsc-bindings-headers\"\n";
+ cout << "// 2. \"make sizegen\"\n";
+ cout << "// 3. \"make jsc-bindings-headers\"\n";
+ cout << "// ------------------------\n";
+ cout << "// You can verify the numbers written in this file at runtime via "
+ "the `extern`d types\n";
+ cout << "// Run \"jsc-bindings-headers\" twice because it uses these values "
+ "in the output. That's how all the bJSC__.* types are created - from "
+ "these values. \n";
+ int i = 0;
+ int len = sizeof(sizes) / sizeof(sizes[0]);
+ for (i = 0; i < len; i++) {
+ cout << "pub const " << names[i] << " = " << sizes[i] << ";\n";
+ cout << "pub const " << names[i] << "_align = " << aligns[i] << ";\n";
+ }
- cout << "// Auto-generated by src/javascript/jsc/headergen/sizegen.cpp at " << buf << ".\n";
- cout << "// These are the byte sizes for the different object types with bindings in JavaScriptCore.\n";
- cout << "// This allows us to safely return stack allocated C++ types to Zig.\n";
- cout << "// It is only safe to do this when these sizes are correct.\n";
- cout << "// That means:\n";
- cout << "// 1. We can't dynamically link JavaScriptCore\n";
- cout << "// 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change.\n";
- cout << "// Failure to do so will lead to undefined behavior and probably some frustrated people.\n";
- cout << "// --- Regenerate this: --- \n";
- cout << "// 1. \"make jsc-bindings-headers\"\n";
- cout << "// 2. \"makpe sizegen\"\n";
- cout << "// 3. \"make jsc-bindings-headers\"\n";
- cout << "// ------------------------\n";
- cout << "// You can verify the numbers written in this file at runtime via the `extern`d types\n";
- cout << "// Run \"jsc-bindings-headers\" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. \n";
- int i = 0;
- int len = sizeof(sizes)/sizeof(sizes[0]);
- for (i = 0; i < len ; i++) {
- cout << "pub const " << names[i] << " = " << sizes[i] << ";\n";
- cout << "pub const " << names[i] << "_align = " << aligns[i] << ";\n";
- }
-
- return 0;
+ return 0;
} \ No newline at end of file