aboutsummaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorrpatters1 <rpatters1@users.noreply.github.com>2022-07-27 01:51:35 -0500
committerGitHub <noreply@github.com>2022-07-27 09:51:35 +0300
commit5a7e3f08886ef2893148c1342fb6021291cf1307 (patch)
tree923de9ce9c045e8f2f55a5acb6b1551911521068 /src/inet.c
parentd1ad8160cba9e504c9d17665492044a93efdc3ab (diff)
downloadluasocket-5a7e3f08886ef2893148c1342fb6021291cf1307.tar.gz
luasocket-5a7e3f08886ef2893148c1342fb6021291cf1307.tar.bz2
luasocket-5a7e3f08886ef2893148c1342fb6021291cf1307.zip
fix(build): Use gai_strerrorA not gai_strerror on Windows
* Explicitly call gai_strerrorA (for Windows builds), so that the code work correctly in 32bit or 64bit builds. * Implement GAI_STRERROR macro to deal with Windows vs. Non-Windows compiles for 64-bit. * make usocket.c consistent with other modules that call macro GAI_STRERROR * Use different name not just different case for macro wrapping function Co-authored-by: Caleb Maclennan <caleb@alerque.com>
Diffstat (limited to 'src/inet.c')
-rwxr-xr-x[-rw-r--r--]src/inet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/inet.c b/src/inet.c
index ec73fea..138c9ab 100644..100755
--- a/src/inet.c
+++ b/src/inet.c
@@ -253,7 +253,7 @@ int inet_meth_getpeername(lua_State *L, p_socket ps, int family)
253 port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); 253 port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV);
254 if (err) { 254 if (err) {
255 lua_pushnil(L); 255 lua_pushnil(L);
256 lua_pushstring(L, gai_strerror(err)); 256 lua_pushstring(L, LUA_GAI_STRERROR(err));
257 return 2; 257 return 2;
258 } 258 }
259 lua_pushstring(L, name); 259 lua_pushstring(L, name);
@@ -286,7 +286,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
286 name, INET6_ADDRSTRLEN, port, 6, NI_NUMERICHOST | NI_NUMERICSERV); 286 name, INET6_ADDRSTRLEN, port, 6, NI_NUMERICHOST | NI_NUMERICSERV);
287 if (err) { 287 if (err) {
288 lua_pushnil(L); 288 lua_pushnil(L);
289 lua_pushstring(L, gai_strerror(err)); 289 lua_pushstring(L, LUA_GAI_STRERROR(err));
290 return 2; 290 return 2;
291 } 291 }
292 lua_pushstring(L, name); 292 lua_pushstring(L, name);