Use different name not just different case for macro wrapping function
This commit is contained in:
parent
4b59d2125f
commit
e95d4bbfd1
5 changed files with 8 additions and 8 deletions
|
@ -253,7 +253,7 @@ int inet_meth_getpeername(lua_State *L, p_socket ps, int family)
|
|||
port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
if (err) {
|
||||
lua_pushnil(L);
|
||||
lua_pushstring(L, GAI_STRERROR(err));
|
||||
lua_pushstring(L, LUA_GAI_STRERROR(err));
|
||||
return 2;
|
||||
}
|
||||
lua_pushstring(L, name);
|
||||
|
@ -286,7 +286,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
|
|||
name, INET6_ADDRSTRLEN, port, 6, NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
if (err) {
|
||||
lua_pushnil(L);
|
||||
lua_pushstring(L, GAI_STRERROR(err));
|
||||
lua_pushstring(L, LUA_GAI_STRERROR(err));
|
||||
return 2;
|
||||
}
|
||||
lua_pushstring(L, name);
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
\*=========================================================================*/
|
||||
#ifdef _WIN32
|
||||
#include "wsocket.h"
|
||||
#define GAI_STRERROR gai_strerrorA
|
||||
#define LUA_GAI_STRERROR gai_strerrorA
|
||||
#else
|
||||
#include "usocket.h"
|
||||
#define GAI_STRERROR gai_strerror
|
||||
#define LUA_GAI_STRERROR gai_strerror
|
||||
#endif
|
||||
|
||||
/*=========================================================================*\
|
||||
|
|
|
@ -191,7 +191,7 @@ static int meth_sendto(lua_State *L) {
|
|||
err = getaddrinfo(ip, port, &aihint, &ai);
|
||||
if (err) {
|
||||
lua_pushnil(L);
|
||||
lua_pushstring(L, GAI_STRERROR(err));
|
||||
lua_pushstring(L, LUA_GAI_STRERROR(err));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ static int meth_receivefrom(lua_State *L) {
|
|||
INET6_ADDRSTRLEN, portstr, 6, NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
if (err) {
|
||||
lua_pushnil(L);
|
||||
lua_pushstring(L, GAI_STRERROR(err));
|
||||
lua_pushstring(L, LUA_GAI_STRERROR(err));
|
||||
if (wanted > sizeof(buf)) free(dgram);
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -449,6 +449,6 @@ const char *socket_gaistrerror(int err) {
|
|||
case EAI_SERVICE: return PIE_SERVICE;
|
||||
case EAI_SOCKTYPE: return PIE_SOCKTYPE;
|
||||
case EAI_SYSTEM: return strerror(errno);
|
||||
default: return GAI_STRERROR(err);
|
||||
default: return LUA_GAI_STRERROR(err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -429,6 +429,6 @@ const char *socket_gaistrerror(int err) {
|
|||
#ifdef EAI_SYSTEM
|
||||
case EAI_SYSTEM: return strerror(errno);
|
||||
#endif
|
||||
default: return GAI_STRERROR(err);
|
||||
default: return LUA_GAI_STRERROR(err);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue