Use the same order as in luasocket.h. --- src/libraries/luasocket/libluasocket/luasocket.c.orig 2015-02-14 14:11:45.000000000 -0600 +++ src/libraries/luasocket/libluasocket/luasocket.c 2024-05-16 06:08:41.000000000 -0500 @@ -110,7 +110,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);