You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/11/11 19:21:49 UTC

[GitHub] [incubator-tvm] jmorrill opened a new pull request #4306: Fix incorrect call to Unicode Win32 InetPton

jmorrill opened a new pull request #4306: Fix incorrect call to Unicode Win32 InetPton
URL: https://github.com/apache/incubator-tvm/pull/4306
 
 
   The recent commit for https://github.com/apache/incubator-tvm/pull/4281 is calling the Win32 MACRO InetPton.  If the Visual studio project is set to "Use Unicode Character Set", (which tvm.dll seems to be) this calls InetPtonW, which uses wchar_t* (aka PCWSTR).  This causes a build error as the "addr_buf" is a char*.
   
   From [InetPton ](https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-inetptonw)docs:
   
   > When UNICODE or _UNICODE is defined, InetPton is defined to InetPtonW, the Unicode version of this function. The pszAddrString parameter is defined to the PCWSTR data type.
   > 
   > When UNICODE or _UNICODE is not defined, InetPton is defined to InetPtonA, the ANSI version of this function. The ANSI version of this function is always defined as inet_pton. The pszAddrString parameter is defined to the PCSTR data type.
   
   This can be fixed by directly calling InetPtonA, which is safe as the tvm function always uses a char* for add_str and InetPtonA always takes a char* (aka PCSTR)
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services