From e826d0c101d750fac8334d71e221c50d8dbe236c Mon Sep 17 00:00:00 2001
From: Mike Pall
Date: Sat, 21 Oct 2023 13:31:45 +0200
Subject: [PATCH] Add 'cc' file type for saving bytecode.
Contributed by Sergey Bronnikov. #1105
---
doc/running.html | 3 ++-
src/jit/bcsave.lua | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/doc/running.html b/doc/running.html
index 3afc1b56..9dd2b411 100644
--- a/doc/running.html
+++ b/doc/running.html
@@ -120,7 +120,8 @@ file name:
- c — C source file, exported bytecode data.
-- h — C header file, static bytecode data.
+- cc — C++ source file, exported bytecode data.
+- h — C/C++ header file, static bytecode data.
- obj or o — Object file, exported bytecode data
(OS- and architecture-specific).
- raw or any other extension — Raw bytecode file (portable).
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua
index 74699f3d..390d297c 100644
--- a/src/jit/bcsave.lua
+++ b/src/jit/bcsave.lua
@@ -38,7 +38,7 @@ Save LuaJIT bytecode: luajit -b[options] input output
-- Stop handling options.
- Use stdin as input and/or stdout as output.
-File types: c h obj o raw (default)
+File types: c cc h obj o raw (default)
]]
os.exit(1)
end
@@ -81,7 +81,7 @@ end
------------------------------------------------------------------------------
local map_type = {
- raw = "raw", c = "c", h = "h", o = "obj", obj = "obj",
+ raw = "raw", c = "c", cc = "c", h = "h", o = "obj", obj = "obj",
}
local map_arch = {