changing WSAPI to support Lua 5.2 (without breaking compatiblity with 5.1)