Use the same order as in luasocket.h. --- src/libraries/luasocket/libluasocket/luasocket.c.orig 2016-10-31 14:23:52.000000000 -0500 +++ src/libraries/luasocket/libluasocket/luasocket.c 2024-05-16 06:10:13.000000000 -0500 @@ -112,7 +112,7 @@ /*-------------------------------------------------------------------------*\ * Initializes all library modules. \*-------------------------------------------------------------------------*/ -int LUASOCKET_API luaopen_socket_core(lua_State *L) { +LUASOCKET_API int luaopen_socket_core(lua_State *L) { int i; base_open(L); for (i = 0; mod[i].name; i++) mod[i].func(L);