5d7117c
diff -up cqueues-rel-20200603/GNUmakefile.lua54 cqueues-rel-20200603/GNUmakefile
5d7117c
--- cqueues-rel-20200603/GNUmakefile.lua54	2020-06-03 02:57:02.000000000 -0400
5d7117c
+++ cqueues-rel-20200603/GNUmakefile	2020-06-30 11:36:27.145696142 -0400
5d7117c
@@ -12,7 +12,7 @@ all: # default target
5d7117c
 #
5d7117c
 # G N U  M A K E  F U N C T I O N S
5d7117c
 #
5d7117c
-KNOWN_APIS = 5.1 5.2 5.3
5d7117c
+KNOWN_APIS = 5.1 5.2 5.3 5.4
5d7117c
 
5d7117c
 # template for invoking luapath script
5d7117c
 LUAPATH := $(d)/mk/luapath
5d7117c
@@ -40,6 +40,9 @@ lua52cpath ?= $(libdir)/lua/5.2
5d7117c
 lua52path ?= $(datadir)/lua/5.2
5d7117c
 lua53cpath ?= $(libdir)/lua/5.3
5d7117c
 lua53path ?= $(datadir)/lua/5.3
5d7117c
+lua54cpath ?= $(libdir)/lua/5.4
5d7117c
+lua54path ?= $(datadir)/lua/5.4
5d7117c
+
5d7117c
 
5d7117c
 AR ?= ar
5d7117c
 RANLIB ?= ranlib
5d7117c
@@ -64,7 +67,7 @@ PRINT_$(d) = printf "%s = %s\n" '$(1)' '
5d7117c
 
5d7117c
 LAZY_$(d) = \
5d7117c
 	prefix includedir libdir datadir bindir \
5d7117c
-	lua51cpath lua51path lua52cpath lua52path lua53cpath lua53path \
5d7117c
+	lua51cpath lua51path lua52cpath lua52path lua53cpath lua53path lua54cpath lua54path \
5d7117c
 	CC ALL_CPPFLAGS CPPFLAGS ALL_CFLAGS CFLAGS ALL_LDFLAGS LDFLAGS \
5d7117c
 	ALL_SOFLAGS SOFLAGS ALL_LIB LIBS \
5d7117c
 	$(foreach API,$(KNOWN_APIS),ALL_LUA$(subst .,,$(API))_CPPFLAGS) \
5d7117c
@@ -96,7 +99,7 @@ endif
5d7117c
 
5d7117c
 # set LUA_APIS if empty or "?"
5d7117c
 ifeq ($(or $(strip $(LUA_APIS)),?),?)
5d7117c
-override LUA_APIS := $(call HAVE_API_FN,5.1) $(call HAVE_API_FN,5.2) $(call HAVE_API_FN,5.3)
5d7117c
+override LUA_APIS := $(call HAVE_API_FN,5.1) $(call HAVE_API_FN,5.2) $(call HAVE_API_FN,5.3) $(call HAVE_API_FN,5.4)
5d7117c
 endif
5d7117c
 
5d7117c
 define LUAXY_template
5d7117c
@@ -131,6 +134,7 @@ endef # LUAXY_template
5d7117c
 $(eval $(call LUAXY_template,5.1))
5d7117c
 $(eval $(call LUAXY_template,5.2))
5d7117c
 $(eval $(call LUAXY_template,5.3))
5d7117c
+$(eval $(call LUAXY_template,5.4))
5d7117c
 
5d7117c
 #
5d7117c
 # A U T O D E T E C T  C O M P I L A T I O N  F L A G S
5d7117c
diff -up cqueues-rel-20200603/src/cqueues.c.lua54 cqueues-rel-20200603/src/cqueues.c
5d7117c
--- cqueues-rel-20200603/src/cqueues.c.lua54	2020-06-30 11:45:50.152509805 -0400
5d7117c
+++ cqueues-rel-20200603/src/cqueues.c	2020-06-30 11:45:55.956415099 -0400
5d7117c
@@ -2050,8 +2050,12 @@ static cqs_status_t cqueue_resume(lua_St
5d7117c
 	timer_del(Q, &T->timer);
5d7117c
 
5d7117c
 	cstack_push(Q->cstack, &(struct stackinfo){ Q, L, I->self, T->L });
5d7117c
-
5d7117c
+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504
5d7117c
+	int nres;
5d7117c
+	status = lua_resume(T->L, L, nargs, &nres);
5d7117c
+#else
5d7117c
 	status = lua_resume(T->L, L, nargs);
5d7117c
+#endif
5d7117c
 
5d7117c
 	cstack_pop(Q->cstack);
5d7117c
 
5d7117c
diff -up cqueues-rel-20200603/src/GNUmakefile.lua54 cqueues-rel-20200603/src/GNUmakefile
5d7117c
--- cqueues-rel-20200603/src/GNUmakefile.lua54	2020-06-03 02:57:02.000000000 -0400
5d7117c
+++ cqueues-rel-20200603/src/GNUmakefile	2020-06-30 11:36:27.145696142 -0400
5d7117c
@@ -67,12 +67,14 @@ $$(d)/$(1)/thread.o: $$(d)/lib/llrb.h
5d7117c
 $$(d)/$(1)/notify.o: $$(d)/lib/notify.h
5d7117c
 
5d7117c
 ifneq ($(1), 5.3)
5d7117c
+ifneq ($(1), 5.4)
5d7117c
 $$(d)/$(1)/compat53.o: $$(d)/../vendor/compat53/c-api/compat-5.3.c $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h
5d7117c
 	$$(MKDIR) -p $$(@D)
5d7117c
 	$$(CC) $$(CFLAGS_$(d)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$(d)) -c -o $$@ $$<
5d7117c
 
5d7117c
 $$(d)/$(1)/cqueues.so: $$(d)/$(1)/compat53.o
5d7117c
 endif
5d7117c
+endif
5d7117c
 
5d7117c
 .SECONDARY: liblua$(1)-cqueues cqueues$(1) cqueues
5d7117c
 
5d7117c
@@ -83,13 +85,15 @@ endef # BUILD_$(d)
5d7117c
 $(eval $(call BUILD_$(d),5.1))
5d7117c
 $(eval $(call BUILD_$(d),5.2))
5d7117c
 $(eval $(call BUILD_$(d),5.3))
5d7117c
+$(eval $(call BUILD_$(d),5.4))
5d7117c
 
5d7117c
 ifneq "$(filter $(abspath $(d)/..)/%, $(abspath $(firstword $(MAKEFILE_LIST))))" ""
5d7117c
-.SECONDARY: all all5.1 all5.2 all5.3
5d7117c
+.SECONDARY: all all5.1 all5.2 all5.3 all5.4
5d7117c
 
5d7117c
 all5.1: liblua5.1-cqueues
5d7117c
 all5.2: liblua5.2-cqueues
5d7117c
 all5.3: liblua5.3-cqueues
5d7117c
+all5.4: liblua5.4-cqueues
5d7117c
 all: $(foreach API,$(strip $(LUA_APIS)),all$(API))
5d7117c
 
5d7117c
 endif
5d7117c
@@ -155,14 +159,16 @@ endef # INSTALL_$(d)
5d7117c
 $(eval $(call INSTALL_$(d),5.1,$$(lua51cpath),$$(lua51path)))
5d7117c
 $(eval $(call INSTALL_$(d),5.2,$$(lua52cpath),$$(lua52path)))
5d7117c
 $(eval $(call INSTALL_$(d),5.3,$$(lua53cpath),$$(lua53path)))
5d7117c
+$(eval $(call INSTALL_$(d),5.4,$$(lua54cpath),$$(lua54path)))
5d7117c
 
5d7117c
 ifneq "$(filter $(abspath $(d)/..)/%, $(abspath $(firstword $(MAKEFILE_LIST))))" ""
5d7117c
 
5d7117c
-.SECONDARY: install5.1 install5.2 install5.3 install
5d7117c
+.SECONDARY: install5.1 install5.2 install5.3 install5.4 install
5d7117c
 
5d7117c
 install5.1: liblua5.1-cqueues-install
5d7117c
 install5.2: liblua5.2-cqueues-install
5d7117c
 install5.3: liblua5.3-cqueues-install
5d7117c
+install5.4: liblua5.4-cqueues-install
5d7117c
 install: $(foreach API,$(strip $(LUA_APIS)),install$(API))
5d7117c
 
5d7117c
 .PHONY: uninstall5.1 uninstall5.2 uninstall5.3 uninstall
5d7117c
@@ -170,6 +176,7 @@ install: $(foreach API,$(strip $(LUA_API
5d7117c
 uninstall5.1: liblua5.1-cqueues-uninstall
5d7117c
 uninstall5.2: liblua5.2-cqueues-uninstall
5d7117c
 uninstall5.3: liblua5.3-cqueues-uninstall
5d7117c
+uninstall5.4: liblua5.4-cqueues-uninstall
5d7117c
 uninstall: $(foreach API,$(strip $(LUA_APIS)),uninstall$(API))
5d7117c
 
5d7117c
 endif
5d7117c
@@ -204,14 +211,17 @@ $(d)/help:
5d7117c
 	@echo "      all5.1 - build 5.1/cqueues.so"
5d7117c
 	@echo "      all5.2 - build 5.2/cqueues.so"
5d7117c
 	@echo "      all5.3 - build 5.3/cqueues.so"
5d7117c
+	@echo "      all5.4 - build 5.4/cqueues.so"
5d7117c
 	@echo "     install - install all API targets"
5d7117c
 	@echo "  install5.1 - install cqueues Lua 5.1 modules"
5d7117c
 	@echo "  install5.2 - install cqueues Lua 5.2 modules"
5d7117c
 	@echo "  install5.3 - install cqueues Lua 5.3 modules"
5d7117c
+	@echo "  install5.4 - install cqueues Lua 5.4 modules"
5d7117c
 	@echo "   uninstall - uninstall all API targets"
5d7117c
 	@echo "uninstall5.1 - uninstall cqueues Lua 5.1 modules"
5d7117c
 	@echo "uninstall5.2 - uninstall cqueues Lua 5.2 modules"
5d7117c
 	@echo "uninstall5.3 - uninstall cqueues Lua 5.3 modules"
5d7117c
+	@echo "uninstall5.4 - uninstall cqueues Lua 5.4 modules"
5d7117c
 	@echo "       clean - rm binary targets, object files, debugging symbols, etc"
5d7117c
 	@echo "      clean~ - clean + rm *~"
5d7117c
 	@echo "        help - echo this help message"
5d7117c
@@ -226,10 +236,13 @@ $(d)/help:
5d7117c
 	@echo 'lua52cpath - install path for Lua 5.2 C modules ($(value lua52cpath))'
5d7117c
 	@echo ' lua53path - install path for Lua 5.3 modules ($(value lua53path))'
5d7117c
 	@echo 'lua53cpath - install path for Lua 5.3 C modules ($(value lua53cpath))'
5d7117c
+	@echo ' lua54path - install path for Lua 5.4 modules ($(value lua54path))'
5d7117c
+	@echo 'lua54cpath - install path for Lua 5.4 C modules ($(value lua54cpath))'
5d7117c
 	@echo ""
5d7117c
 	@echo 'LUA51_CPPFLAGS - cpp flags for Lua 5.1 headers ($(LUA51_CPPFLAGS))'
5d7117c
 	@echo 'LUA52_CPPFLAGS - cpp flags for Lua 5.2 headers ($(LUA52_CPPFLAGS))'
5d7117c
 	@echo 'LUA53_CPPFLAGS - cpp flags for Lua 5.3 headers ($(LUA53_CPPFLAGS))'
5d7117c
+	@echo 'LUA54_CPPFLAGS - cpp flags for Lua 5.4 headers ($(LUA54_CPPFLAGS))'
5d7117c
 	@echo ""
5d7117c
 	@echo "(NOTE: all the common GNU-style paths are supported, including"
5d7117c
 	@echo "prefix, bindir, libdir, datadir, includedir, and DESTDIR.)"
5d7117c
diff -up cqueues-rel-20200603/vendor/compat53/c-api/compat-5.3.h.lua54 cqueues-rel-20200603/vendor/compat53/c-api/compat-5.3.h
5d7117c
--- cqueues-rel-20200603/vendor/compat53/c-api/compat-5.3.h.lua54	2020-06-03 02:57:02.000000000 -0400
5d7117c
+++ cqueues-rel-20200603/vendor/compat53/c-api/compat-5.3.h	2020-06-30 11:36:27.145696142 -0400
5d7117c
@@ -395,11 +395,11 @@ COMPAT53_API void luaL_requiref (lua_Sta
5d7117c
 
5d7117c
 
5d7117c
 /* other Lua versions */
5d7117c
-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503
5d7117c
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504
5d7117c
 
5d7117c
-#  error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)"
5d7117c
+#  error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)"
5d7117c
 
5d7117c
-#endif /* other Lua versions except 5.1, 5.2, and 5.3 */
5d7117c
+#endif /* other Lua versions except 5.1, 5.2, 5.3, 5.4 */
5d7117c
 
5d7117c
 
5d7117c