lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi!

In `lua.h`, `LUA_VERSION_RELEASE_NUM`  does not reflect `LUA_VERSION_RELEASE`,
and `LUA_VERSION_NUM` is hard-coded although it can be calculated from  `LUA_VERSION_MAJOR` and  `LUA_VERSION_MINOR`.

Here is a patch to fix them (a base64-encoded data is enclosed also, in case TABs are converted to spaces).

Regards,

Lem

---------------- cut here ----------------
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lemures Lemniscati <lemures.lemniscati@gmail.com>
Date: Tue, 12 Jan 2021 20:17:59 +0900
Subject: [PATCH] Fix LUA_VERSION_RELEASE_NUM and LUA_VERSION_NUM

* Fix LUA_VERSION_RELEASE_NUM, so that it reflects LUA_VERSION_RELEASE
* Modify LUA_VERSION_NUM, so that it reflects LUA_VERSION_MAJOR and _MINOR

diff --git a/lua.h b/lua.h
index c9d64d7f..bef92eae 100644
--- a/lua.h
+++ b/lua.h
@@ -20,8 +20,8 @@
 #define LUA_VERSION_MINOR	"4"
 #define LUA_VERSION_RELEASE	"2"
 
-#define LUA_VERSION_NUM			504
-#define LUA_VERSION_RELEASE_NUM		(LUA_VERSION_NUM * 100 + 0)
+#define LUA_VERSION_NUM		(LUA_VERSION_MAJOR * 100 + LUA_VERSION_MINOR)
+#define LUA_VERSION_RELEASE_NUM	(LUA_VERSION_NUM * 100 + LUA_VERSION_RELEASE)
 
 #define LUA_VERSION	"Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
 #define LUA_RELEASE	LUA_VERSION "." LUA_VERSION_RELEASE


---------------- cut here ----------------
#!/bin/sh
/usr/bin/env base64 -d << __END__ > 0001-Fix-LUA_VERSION_RELEASE_NUM-and-LUA_VERSION_NUM.patch
RnJvbSAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMZW11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