Hello community,

here is the log from the commit of package lua-compat-5.3 for openSUSE:Factory 
checked in at 2020-07-15 15:00:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua-compat-5.3 (Old)
 and      /work/SRC/openSUSE:Factory/.lua-compat-5.3.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lua-compat-5.3"

Wed Jul 15 15:00:59 2020 rev:3 rq:820839 version:0.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/lua-compat-5.3/lua-compat-5.3.changes    
2019-11-11 13:01:27.629758314 +0100
+++ /work/SRC/openSUSE:Factory/.lua-compat-5.3.new.3060/lua-compat-5.3.changes  
2020-07-15 15:01:21.603195881 +0200
@@ -1,0 +2,18 @@
+Sun Jul 12 14:02:52 UTC 2020 - Callum Farmer <[email protected]>
+
+- Removed lua54-support.patch: contained in upstream
+- Update to version 0.9
+  * Lua 5.4 is supported
+  * Added bit32 library compatibility module.
+
+-------------------------------------------------------------------
+Mon Jul  6 21:15:52 UTC 2020 - Matej Cepl <[email protected]>
+
+- Add lua54-support.patch for support of Lua 5.4
+
+-------------------------------------------------------------------
+Mon Jul  6 19:02:29 UTC 2020 - Matej Cepl <[email protected]>
+
+- Add lua54 as new build target
+
+-------------------------------------------------------------------

Old:
----
  lua-compat-5.3-0.7.tar.gz

New:
----
  lua-compat-5.3-0.9.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lua-compat-5.3.spec ++++++
--- /var/tmp/diff_new_pack.tfOjRs/_old  2020-07-15 15:01:22.635196887 +0200
+++ /var/tmp/diff_new_pack.tfOjRs/_new  2020-07-15 15:01:22.639196892 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package lua-compat-5.3
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define flavor @BUILD_FLAVOR@
 %define mod_name lua-compat-5.3
-Version:        0.7
+Version:        0.9
 Release:        0
 Summary:        Lua-5.3-style APIs for Lua 5.2 and 5.1
 License:        MIT
@@ -40,7 +40,7 @@
 This package provides terminal operations for Lua
 
 %prep
-%setup -q -n %{mod_name}-%{version}
+%autosetup -n %{mod_name}-%{version}
 
 %build
 export CC="${COMPILER:-gcc}" DEF="" SRC="" CFLAGS="-Wall -Wextra $(pkg-config 
--cflags lua%{lua_version}) -Ic-api -O2 -fPIC"

++++++ _multibuild ++++++
--- /var/tmp/diff_new_pack.tfOjRs/_old  2020-07-15 15:01:22.667196919 +0200
+++ /var/tmp/diff_new_pack.tfOjRs/_new  2020-07-15 15:01:22.667196919 +0200
@@ -1,4 +1,5 @@
 <multibuild>
 <package>lua51</package>
 <package>lua53</package>
+<package>lua54</package>
 </multibuild>

++++++ lua-compat-5.3-0.7.tar.gz -> lua-compat-5.3-0.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/README.md 
new/lua-compat-5.3-0.9/README.md
--- old/lua-compat-5.3-0.7/README.md    2018-04-26 07:30:08.000000000 +0200
+++ new/lua-compat-5.3-0.9/README.md    2020-07-09 01:27:24.000000000 +0200
@@ -35,7 +35,7 @@
 a meaningful return value, so the usual idiom of storing the return of
 `require` in a local variable makes no sense.
 
-When run under Lua 5.3, this module does nothing.
+When run under Lua 5.3+, this module does nothing.
 
 When run under Lua 5.2 or 5.1, it replaces some of your standard
 functions and adds new ones to bring your environment closer to that
@@ -125,6 +125,7 @@
 * `lua_KContext` (see [here][14])
 * `lua_KFunction` (see [here][14])
 * `lua_dump` (extra `strip` parameter, ignored, see [here][15])
+* `lua_getextraspace` (limited compatibilitiy, see [here][24])
 * `lua_getfield` (return value)
 * `lua_geti` and `lua_seti`
 * `lua_getglobal` (return value)
@@ -186,7 +187,6 @@
   [`lua-compat-5.2`][2] for a detailed list.
 * the following C API functions/macros:
   * `lua_isyieldable`
-  * `lua_getextraspace`
   * `lua_arith` (new operators missing)
   * `lua_push(v)fstring` (new formats missing)
   * `lua_upvalueid` (5.1)
@@ -236,4 +236,5 @@
   [21]: https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_checkversion
   [22]: https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Buffer
   [23]: https://github.com/keplerproject/lua-compat-5.3/wiki/coroutine.running
+  [24]: https://github.com/keplerproject/lua-compat-5.3/wiki/lua_getextraspace
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/c-api/compat-5.3.c 
new/lua-compat-5.3-0.9/c-api/compat-5.3.c
--- old/lua-compat-5.3-0.7/c-api/compat-5.3.c   2018-04-26 07:30:08.000000000 
+0200
+++ new/lua-compat-5.3-0.9/c-api/compat-5.3.c   2020-07-09 01:27:24.000000000 
+0200
@@ -28,8 +28,9 @@
 #endif /* VC++ _fsopen for share-allowed file read */
 
 #ifndef COMPAT53_HAVE_STRERROR_R
-#  if defined(__GLIBC__) || defined(_POSIX_VERSION) || defined(__APPLE__) || \
-      (!defined (__MINGW32__) && defined(__GNUC__) && (__GNUC__ < 6))
+#  if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
+      (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \
+      defined(__APPLE__)
 #    define COMPAT53_HAVE_STRERROR_R 1
 #  else /* none of the defines matched: define to 0 */
 #    define COMPAT53_HAVE_STRERROR_R 0
@@ -448,7 +449,9 @@
 
 COMPAT53_API int lua_load (lua_State *L, lua_Reader reader, void *data, const 
char *source, const char *mode) {
   int status = LUA_OK;
-  compat53_reader_data compat53_data = { reader, data, 1, 0, 0 };
+  compat53_reader_data compat53_data = { 0, NULL, 1, 0, 0 };
+  compat53_data.reader = reader;
+  compat53_data.ud = data;
   compat53_data.peeked_data = reader(L, data, 
&(compat53_data.peeked_data_size));
   if (compat53_data.peeked_data && compat53_data.peeked_data_size &&
       compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */
@@ -720,6 +723,63 @@
 }
 
 
+#ifndef LUA_EXTRASPACE
+#define LUA_EXTRASPACE (sizeof(void*))
+#endif
+
+COMPAT53_API void *lua_getextraspace (lua_State *L) {
+  int is_main = 0;
+  void *ptr = NULL;
+  luaL_checkstack(L, 4, "not enough stack slots available");
+  lua_pushliteral(L, "__compat53_extraspace");
+  lua_pushvalue(L, -1);
+  lua_rawget(L, LUA_REGISTRYINDEX);
+  if (!lua_istable(L, -1)) {
+    lua_pop(L, 1);
+    lua_createtable(L, 0, 2);
+    lua_createtable(L, 0, 1);
+    lua_pushliteral(L, "k");
+    lua_setfield(L, -2, "__mode");
+    lua_setmetatable(L, -2);
+    lua_pushvalue(L, -2);
+    lua_pushvalue(L, -2);
+    lua_rawset(L, LUA_REGISTRYINDEX);
+  }
+  lua_replace(L, -2);
+  is_main = lua_pushthread(L);
+  lua_rawget(L, -2);
+  ptr = lua_touserdata(L, -1);
+  if (!ptr) {
+    lua_pop(L, 1);
+    ptr = lua_newuserdata(L, LUA_EXTRASPACE);
+    if (is_main) {
+      memset(ptr, '\0', LUA_EXTRASPACE);
+      lua_pushthread(L);
+      lua_pushvalue(L, -2);
+      lua_rawset(L, -4);
+      lua_pushboolean(L, 1);
+      lua_pushvalue(L, -2);
+      lua_rawset(L, -4);
+    } else {
+      void* mptr = NULL;
+      lua_pushboolean(L, 1);
+      lua_rawget(L, -3);
+      mptr = lua_touserdata(L, -1);
+      if (mptr)
+        memcpy(ptr, mptr, LUA_EXTRASPACE);
+      else
+        memset(ptr, '\0', LUA_EXTRASPACE);
+      lua_pop(L, 1);
+      lua_pushthread(L);
+      lua_pushvalue(L, -2);
+      lua_rawset(L, -4);
+    }
+  }
+  lua_pop(L, 2);
+  return ptr;
+}
+
+
 COMPAT53_API int lua_isinteger (lua_State *L, int index) {
   if (lua_type(L, index) == LUA_TNUMBER) {
     lua_Number n = lua_tonumber(L, index);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/c-api/compat-5.3.h 
new/lua-compat-5.3-0.9/c-api/compat-5.3.h
--- old/lua-compat-5.3-0.7/c-api/compat-5.3.h   2018-04-26 07:30:08.000000000 
+0200
+++ new/lua-compat-5.3-0.9/c-api/compat-5.3.h   2020-07-09 01:27:24.000000000 
+0200
@@ -293,6 +293,9 @@
 #define lua_geti COMPAT53_CONCAT(COMPAT53_PREFIX, _geti)
 COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i);
 
+#define lua_getextraspace COMPAT53_CONCAT(COMPAT53_PREFIX, _getextraspace)
+COMPAT53_API void *lua_getextraspace (lua_State *L);
+
 #define lua_isinteger COMPAT53_CONCAT(COMPAT53_PREFIX, _isinteger)
 COMPAT53_API int lua_isinteger (lua_State *L, int index);
 
@@ -339,7 +342,6 @@
 
 /* XXX not implemented:
  * lua_isyieldable
- * lua_getextraspace
  * lua_arith (new operators)
  * lua_pushfstring (new formats)
  */
@@ -397,11 +399,11 @@
 
 
 /* other Lua versions */
-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504
 
-#  error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)"
+#  error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)"
 
-#endif /* other Lua versions except 5.1, 5.2, and 5.3 */
+#endif /* other Lua versions except 5.1, 5.2, 5.3, and 5.4 */
 
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/lbitlib.c 
new/lua-compat-5.3-0.9/lbitlib.c
--- old/lua-compat-5.3-0.7/lbitlib.c    1970-01-01 01:00:00.000000000 +0100
+++ new/lua-compat-5.3-0.9/lbitlib.c    2020-07-09 01:27:24.000000000 +0200
@@ -0,0 +1,233 @@
+/*
+** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $
+** Standard library for bitwise operations
+** See Copyright Notice in lua.h
+*/
+
+#define lbitlib_c
+#define LUA_LIB
+
+#include "lprefix.h"
+
+
+#include "lua.h"
+
+#include "lauxlib.h"
+#include "lualib.h"
+
+
+#if defined(LUA_COMPAT_BITLIB)         /* { */
+
+
+#define pushunsigned(L,n)      lua_pushinteger(L, (lua_Integer)(n))
+#define checkunsigned(L,i)     ((lua_Unsigned)luaL_checkinteger(L,i))
+
+
+/* number of bits to consider in a number */
+#if !defined(LUA_NBITS)
+#define LUA_NBITS      32
+#endif
+
+
+/*
+** a lua_Unsigned with its first LUA_NBITS bits equal to 1. (Shift must
+** be made in two parts to avoid problems when LUA_NBITS is equal to the
+** number of bits in a lua_Unsigned.)
+*/
+#define ALLONES                (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 
1))
+
+
+/* macro to trim extra bits */
+#define trim(x)                ((x) & ALLONES)
+
+
+/* builds a number with 'n' ones (1 <= n <= LUA_NBITS) */
+#define mask(n)                (~((ALLONES << 1) << ((n) - 1)))
+
+
+
+static lua_Unsigned andaux (lua_State *L) {
+  int i, n = lua_gettop(L);
+  lua_Unsigned r = ~(lua_Unsigned)0;
+  for (i = 1; i <= n; i++)
+    r &= checkunsigned(L, i);
+  return trim(r);
+}
+
+
+static int b_and (lua_State *L) {
+  lua_Unsigned r = andaux(L);
+  pushunsigned(L, r);
+  return 1;
+}
+
+
+static int b_test (lua_State *L) {
+  lua_Unsigned r = andaux(L);
+  lua_pushboolean(L, r != 0);
+  return 1;
+}
+
+
+static int b_or (lua_State *L) {
+  int i, n = lua_gettop(L);
+  lua_Unsigned r = 0;
+  for (i = 1; i <= n; i++)
+    r |= checkunsigned(L, i);
+  pushunsigned(L, trim(r));
+  return 1;
+}
+
+
+static int b_xor (lua_State *L) {
+  int i, n = lua_gettop(L);
+  lua_Unsigned r = 0;
+  for (i = 1; i <= n; i++)
+    r ^= checkunsigned(L, i);
+  pushunsigned(L, trim(r));
+  return 1;
+}
+
+
+static int b_not (lua_State *L) {
+  lua_Unsigned r = ~checkunsigned(L, 1);
+  pushunsigned(L, trim(r));
+  return 1;
+}
+
+
+static int b_shift (lua_State *L, lua_Unsigned r, lua_Integer i) {
+  if (i < 0) {  /* shift right? */
+    i = -i;
+    r = trim(r);
+    if (i >= LUA_NBITS) r = 0;
+    else r >>= i;
+  }
+  else {  /* shift left */
+    if (i >= LUA_NBITS) r = 0;
+    else r <<= i;
+    r = trim(r);
+  }
+  pushunsigned(L, r);
+  return 1;
+}
+
+
+static int b_lshift (lua_State *L) {
+  return b_shift(L, checkunsigned(L, 1), luaL_checkinteger(L, 2));
+}
+
+
+static int b_rshift (lua_State *L) {
+  return b_shift(L, checkunsigned(L, 1), -luaL_checkinteger(L, 2));
+}
+
+
+static int b_arshift (lua_State *L) {
+  lua_Unsigned r = checkunsigned(L, 1);
+  lua_Integer i = luaL_checkinteger(L, 2);
+  if (i < 0 || !(r & ((lua_Unsigned)1 << (LUA_NBITS - 1))))
+    return b_shift(L, r, -i);
+  else {  /* arithmetic shift for 'negative' number */
+    if (i >= LUA_NBITS) r = ALLONES;
+    else
+      r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i));  /* add signal bit 
*/
+    pushunsigned(L, r);
+    return 1;
+  }
+}
+
+
+static int b_rot (lua_State *L, lua_Integer d) {
+  lua_Unsigned r = checkunsigned(L, 1);
+  int i = d & (LUA_NBITS - 1);  /* i = d % NBITS */
+  r = trim(r);
+  if (i != 0)  /* avoid undefined shift of LUA_NBITS when i == 0 */
+    r = (r << i) | (r >> (LUA_NBITS - i));
+  pushunsigned(L, trim(r));
+  return 1;
+}
+
+
+static int b_lrot (lua_State *L) {
+  return b_rot(L, luaL_checkinteger(L, 2));
+}
+
+
+static int b_rrot (lua_State *L) {
+  return b_rot(L, -luaL_checkinteger(L, 2));
+}
+
+
+/*
+** get field and width arguments for field-manipulation functions,
+** checking whether they are valid.
+** ('luaL_error' called without 'return' to avoid later warnings about
+** 'width' being used uninitialized.)
+*/
+static int fieldargs (lua_State *L, int farg, int *width) {
+  lua_Integer f = luaL_checkinteger(L, farg);
+  lua_Integer w = luaL_optinteger(L, farg + 1, 1);
+  luaL_argcheck(L, 0 <= f, farg, "field cannot be negative");
+  luaL_argcheck(L, 0 < w, farg + 1, "width must be positive");
+  if (f + w > LUA_NBITS)
+    luaL_error(L, "trying to access non-existent bits");
+  *width = (int)w;
+  return (int)f;
+}
+
+
+static int b_extract (lua_State *L) {
+  int w;
+  lua_Unsigned r = trim(checkunsigned(L, 1));
+  int f = fieldargs(L, 2, &w);
+  r = (r >> f) & mask(w);
+  pushunsigned(L, r);
+  return 1;
+}
+
+
+static int b_replace (lua_State *L) {
+  int w;
+  lua_Unsigned r = trim(checkunsigned(L, 1));
+  lua_Unsigned v = trim(checkunsigned(L, 2));
+  int f = fieldargs(L, 3, &w);
+  lua_Unsigned m = mask(w);
+  r = (r & ~(m << f)) | ((v & m) << f);
+  pushunsigned(L, r);
+  return 1;
+}
+
+
+static const luaL_Reg bitlib[] = {
+  {"arshift", b_arshift},
+  {"band", b_and},
+  {"bnot", b_not},
+  {"bor", b_or},
+  {"bxor", b_xor},
+  {"btest", b_test},
+  {"extract", b_extract},
+  {"lrotate", b_lrot},
+  {"lshift", b_lshift},
+  {"replace", b_replace},
+  {"rrotate", b_rrot},
+  {"rshift", b_rshift},
+  {NULL, NULL}
+};
+
+
+
+LUAMOD_API int luaopen_bit32 (lua_State *L) {
+  luaL_newlib(L, bitlib);
+  return 1;
+}
+
+
+#else                                  /* }{ */
+
+
+LUAMOD_API int luaopen_bit32 (lua_State *L) {
+  return luaL_error(L, "library 'bit32' has been deprecated");
+}
+
+#endif                                 /* } */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/lstrlib.c 
new/lua-compat-5.3-0.9/lstrlib.c
--- old/lua-compat-5.3-0.7/lstrlib.c    2018-04-26 07:30:08.000000000 +0200
+++ new/lua-compat-5.3-0.9/lstrlib.c    2020-07-09 01:27:24.000000000 +0200
@@ -1,5 +1,5 @@
 /*
-** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 roberto Exp $
+** $Id: lstrlib.c,v 1.254.1.1 2017/04/19 17:29:57 roberto Exp $
 ** Standard library for string operations and pattern-matching
 ** See Copyright Notice in lua.h
 */
@@ -879,7 +879,7 @@
       buff[i] = toupper(uchar(buff[i]));
   }
   else if (fmt[SIZELENMOD] != 'a')
-    luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
+    return luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented");
   return n;
 }
 
@@ -1199,8 +1199,8 @@
 static int getnumlimit (Header *h, const char **fmt, int df) {
   int sz = getnum(fmt, df);
   if (sz > MAXINTSIZE || sz <= 0)
-    luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
-                     sz, MAXINTSIZE);
+    return luaL_error(h->L, "integral size (%d) out of limits [1,%d]",
+                            sz, MAXINTSIZE);
   return sz;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/ltablib.c 
new/lua-compat-5.3-0.9/ltablib.c
--- old/lua-compat-5.3-0.7/ltablib.c    2018-04-26 07:30:08.000000000 +0200
+++ new/lua-compat-5.3-0.9/ltablib.c    2020-07-09 01:27:24.000000000 +0200
@@ -1,5 +1,5 @@
 /*
-** $Id: ltablib.c,v 1.93 2016/02/25 19:41:54 roberto Exp $
+** $Id: ltablib.c,v 1.93.1.1 2017/04/19 17:20:42 roberto Exp $
 ** Library for Table Manipulation
 ** See Copyright Notice in lua.h
 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/lutf8lib.c 
new/lua-compat-5.3-0.9/lutf8lib.c
--- old/lua-compat-5.3-0.7/lutf8lib.c   2018-04-26 07:30:08.000000000 +0200
+++ new/lua-compat-5.3-0.9/lutf8lib.c   2020-07-09 01:27:24.000000000 +0200
@@ -1,5 +1,5 @@
 /*
-** $Id: lutf8lib.c,v 1.16 2016/12/22 13:08:50 roberto Exp $
+** $Id: lutf8lib.c,v 1.16.1.1 2017/04/19 17:29:57 roberto Exp $
 ** Standard library for UTF-8 manipulation
 ** See Copyright Notice in lua.h
 */
@@ -171,7 +171,7 @@
   }
   else {
     if (iscont(s + posi))
-      luaL_error(L, "initial position is a continuation byte");
+      return luaL_error(L, "initial position is a continuation byte");
     if (n < 0) {
        while (n < 0 && posi > 0) {  /* move back */
          do {  /* find beginning of previous character */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/rockspecs/bit32-5.3.5-1.rockspec 
new/lua-compat-5.3-0.9/rockspecs/bit32-5.3.5-1.rockspec
--- old/lua-compat-5.3-0.7/rockspecs/bit32-5.3.5-1.rockspec     1970-01-01 
01:00:00.000000000 +0100
+++ new/lua-compat-5.3-0.9/rockspecs/bit32-5.3.5-1.rockspec     2020-07-09 
01:27:24.000000000 +0200
@@ -0,0 +1,28 @@
+package = "bit32"
+version = "5.3.5-1"
+source = {
+   url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.zip";,
+   dir = "lua-compat-5.3-0.9",
+}
+description = {
+   summary = "Lua 5.2 bit manipulation library",
+   detailed = [[
+      bit32 is the native Lua 5.2 bit manipulation library, in the version
+      from Lua 5.3; it is compatible with Lua 5.1, 5.2 and 5.3.
+   ]],
+   homepage = "http://www.lua.org/manual/5.2/manual.html#6.7";,
+   license = "MIT"
+}
+dependencies = {
+   "lua >= 5.1, < 5.5"
+}
+build = {
+   type = "builtin",
+   modules = {
+      bit32 = {
+         sources = { "lbitlib.c" },
+         defines = { "LUA_COMPAT_BITLIB" },
+         incdirs = { "c-api" },
+      }
+   }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/rockspecs/bit32-scm-1.rockspec 
new/lua-compat-5.3-0.9/rockspecs/bit32-scm-1.rockspec
--- old/lua-compat-5.3-0.7/rockspecs/bit32-scm-1.rockspec       1970-01-01 
01:00:00.000000000 +0100
+++ new/lua-compat-5.3-0.9/rockspecs/bit32-scm-1.rockspec       2020-07-09 
01:27:24.000000000 +0200
@@ -0,0 +1,28 @@
+package = "bit32"
+version = "scm-1"
+source = {
+   url = "https://github.com/keplerproject/lua-compat-5.3/archive/master.zip";,
+   branch = "lua-compat-5.3-master",
+}
+description = {
+   summary = "Lua 5.2 bit manipulation library",
+   detailed = [[
+      bit32 is the native Lua 5.2 bit manipulation library, in the version
+      from Lua 5.3; it is compatible with Lua 5.1, 5.2 and 5.3.
+   ]],
+   homepage = "http://www.lua.org/manual/5.2/manual.html#6.7";,
+   license = "MIT"
+}
+dependencies = {
+   "lua >= 5.1, < 5.5"
+}
+build = {
+   type = "builtin",
+   modules = {
+      bit32 = {
+         sources = { "lbitlib.c" },
+         defines = { "LUA_COMPAT_BITLIB" },
+         incdirs = { "c-api" },
+      }
+   }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/rockspecs/compat53-0.7-1.rockspec 
new/lua-compat-5.3-0.9/rockspecs/compat53-0.7-1.rockspec
--- old/lua-compat-5.3-0.7/rockspecs/compat53-0.7-1.rockspec    1970-01-01 
01:00:00.000000000 +0100
+++ new/lua-compat-5.3-0.9/rockspecs/compat53-0.7-1.rockspec    2020-07-09 
01:27:24.000000000 +0200
@@ -0,0 +1,32 @@
+package = "compat53"
+version = "0.7-1"
+source = {
+   url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.7.zip";,
+   dir = "lua-compat-5.3-0.7",
+}
+description = {
+   summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 
and 5.1",
+   detailed = [[
+      This is a small module that aims to make it easier to write Lua
+      code in a Lua-5.3-style that runs on Lua 5.3, 5.2, and 5.1.
+      It does *not* make Lua 5.2 (or even 5.1) entirely compatible
+      with Lua 5.3, but it brings the API closer to that of Lua 5.3.
+   ]],
+   homepage = "https://github.com/keplerproject/lua-compat-5.3";,
+   license = "MIT"
+}
+dependencies = {
+   "lua >= 5.1, < 5.4",
+   --"struct" -- make Roberto's struct module optional
+}
+build = {
+   type = "builtin",
+   modules = {
+      ["compat53.init"] = "compat53/init.lua",
+      ["compat53.module"] = "compat53/module.lua",
+      ["compat53.utf8"] = "lutf8lib.c",
+      ["compat53.table"] = "ltablib.c",
+      ["compat53.string"] = "lstrlib.c",
+   }
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/rockspecs/compat53-0.8-1.rockspec 
new/lua-compat-5.3-0.9/rockspecs/compat53-0.8-1.rockspec
--- old/lua-compat-5.3-0.7/rockspecs/compat53-0.8-1.rockspec    1970-01-01 
01:00:00.000000000 +0100
+++ new/lua-compat-5.3-0.9/rockspecs/compat53-0.8-1.rockspec    2020-07-09 
01:27:24.000000000 +0200
@@ -0,0 +1,32 @@
+package = "compat53"
+version = "0.8-1"
+source = {
+   url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.8.zip";,
+   dir = "lua-compat-5.3-0.8",
+}
+description = {
+   summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 
and 5.1",
+   detailed = [[
+      This is a small module that aims to make it easier to write Lua
+      code in a Lua-5.3-style that runs on Lua 5.1+.
+      It does *not* make Lua 5.2 (or even 5.1) entirely compatible
+      with Lua 5.3, but it brings the API closer to that of Lua 5.3.
+   ]],
+   homepage = "https://github.com/keplerproject/lua-compat-5.3";,
+   license = "MIT"
+}
+dependencies = {
+   "lua >= 5.1, < 5.5",
+   --"struct" -- make Roberto's struct module optional
+}
+build = {
+   type = "builtin",
+   modules = {
+      ["compat53.init"] = "compat53/init.lua",
+      ["compat53.module"] = "compat53/module.lua",
+      ["compat53.utf8"] = "lutf8lib.c",
+      ["compat53.table"] = "ltablib.c",
+      ["compat53.string"] = "lstrlib.c",
+   }
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/rockspecs/compat53-scm-0.rockspec 
new/lua-compat-5.3-0.9/rockspecs/compat53-scm-0.rockspec
--- old/lua-compat-5.3-0.7/rockspecs/compat53-scm-0.rockspec    2018-04-26 
07:30:08.000000000 +0200
+++ new/lua-compat-5.3-0.9/rockspecs/compat53-scm-0.rockspec    2020-07-09 
01:27:24.000000000 +0200
@@ -8,7 +8,7 @@
    summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 
and 5.1",
    detailed = [[
       This is a small module that aims to make it easier to write Lua
-      code in a Lua-5.3-style that runs on Lua 5.3, 5.2, and 5.1.
+      code in a Lua-5.3-style that runs on Lua 5.1+.
       It does *not* make Lua 5.2 (or even 5.1) entirely compatible
       with Lua 5.3, but it brings the API closer to that of Lua 5.3.
    ]],
@@ -16,7 +16,7 @@
    license = "MIT"
 }
 dependencies = {
-   "lua >= 5.1, < 5.4",
+   "lua >= 5.1, < 5.5",
    --"struct" -- make Roberto's struct module optional
 }
 build = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/tests/test-bit32.lua 
new/lua-compat-5.3-0.9/tests/test-bit32.lua
--- old/lua-compat-5.3-0.7/tests/test-bit32.lua 1970-01-01 01:00:00.000000000 
+0100
+++ new/lua-compat-5.3-0.9/tests/test-bit32.lua 2020-07-09 01:27:24.000000000 
+0200
@@ -0,0 +1,9 @@
+#!/usr/bin/env lua
+
+local bit32 = require("bit32")
+
+
+assert(bit32.bnot(0) == 2^32-1)
+assert(bit32.band(1, 3, 5) == 1)
+assert(bit32.bor(1, 3, 5) == 7)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/tests/test.lua 
new/lua-compat-5.3-0.9/tests/test.lua
--- old/lua-compat-5.3-0.7/tests/test.lua       2018-04-26 07:30:08.000000000 
+0200
+++ new/lua-compat-5.3-0.9/tests/test.lua       2020-07-09 01:27:24.000000000 
+0200
@@ -664,14 +664,12 @@
 print("isinteger", mod.isinteger(math.huge))
 print("isinteger", mod.isinteger(math.sqrt(-1)))
 
-
 ___''
 print("rotate", mod.rotate(1, 1, 2, 3, 4, 5, 6))
 print("rotate", mod.rotate(-1, 1, 2, 3, 4, 5, 6))
 print("rotate", mod.rotate(4, 1, 2, 3, 4, 5, 6))
 print("rotate", mod.rotate(-4, 1, 2, 3, 4, 5, 6))
 
-
 ___''
 print("strtonum", mod.strtonum("+123"))
 print("strtonum", mod.strtonum(" 123 "))
@@ -679,7 +677,6 @@
 print("strtonum", mod.strtonum(" 123 abc"))
 print("strtonum", mod.strtonum("jkl"))
 
-
 ___''
 local a, b, c = mod.requiref()
 print("requiref", type(a), type(b), type(c),
@@ -687,6 +684,34 @@
       type(requiref1), type(requiref2), type(requiref3))
 
 ___''
+local c = coroutine.wrap(function()
+  mod.extraspace("uvw")
+  print("getextraspace", mod.extraspace())
+  coroutine.yield()
+  print("getextraspace", mod.extraspace())
+  coroutine.yield()
+  print("getextraspace", mod.extraspace())
+end)
+c()
+mod.extraspace("abc")
+print("getextraspace", mod.extraspace())
+c()
+local d = coroutine.wrap(function()
+  print("getextraspace", mod.extraspace())
+  mod.extraspace("xyz")
+  print("getextraspace", mod.extraspace())
+  coroutine.yield()
+  print("getextraspace", mod.extraspace())
+  coroutine.yield()
+  print("getextraspace", mod.extraspace())
+end)
+d()
+print("getextraspace", mod.extraspace())
+mod.extraspace("123")
+c()
+d()
+
+___''
 local proxy, backend = {}, {}
 setmetatable(proxy, { __index = backend, __newindex = backend })
 print("geti/seti", rawget(proxy, 1), rawget(backend, 1))
@@ -705,7 +730,7 @@
 
 ___''
 print("tointeger", mod.tointeger(12))
-print("tointeger", mod.tointeger(-12))
+print("tointeger", mod.tointeger(12))
 print("tointeger", mod.tointeger(12.1))
 print("tointeger", mod.tointeger(12.9))
 print("tointeger", mod.tointeger(-12.1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-compat-5.3-0.7/tests/testmod.c 
new/lua-compat-5.3-0.9/tests/testmod.c
--- old/lua-compat-5.3-0.7/tests/testmod.c      2018-04-26 07:30:08.000000000 
+0200
+++ new/lua-compat-5.3-0.9/tests/testmod.c      2020-07-09 01:27:24.000000000 
+0200
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
 #include "compat-5.3.h"
 
 
@@ -63,6 +64,21 @@
 }
 
 
+#ifndef LUA_EXTRASPACE
+#define LUA_EXTRASPACE (sizeof(void*))
+#endif
+
+static int test_getextraspace (lua_State *L) {
+  size_t len = 0;
+  char const* s = luaL_optlstring(L, 1, NULL, &len);
+  char* p = (char*)lua_getextraspace(L);
+  lua_pushstring(L, p);
+  if (s)
+    memcpy(p, s, len > LUA_EXTRASPACE-1 ? LUA_EXTRASPACE-1 : len+1);
+  return 1;
+}
+
+
 /* additional tests for Lua5.1 */
 #define NUP 3
 
@@ -270,6 +286,7 @@
 
 static int test_exec (lua_State *L) {
   const char *cmd = luaL_checkstring(L, 1);
+  errno = 0;
   return luaL_execresult(L, system(cmd));
 }
 
@@ -307,6 +324,7 @@
   { "strtonum", test_str2num },
   { "requiref", test_requiref },
   { "getseti", test_getseti },
+  { "extraspace", test_getextraspace },
   { "newproxy", test_newproxy },
   { "arith", test_arith },
   { "compare", test_compare },


Reply via email to