Hi On Thu, Nov 22, 2018 at 9:45 AM Liu Hao <[email protected]> wrote: > > 在 2018/11/22 6:13, Marc-André Lureau 写道: > > > > It looks like this: > > #define InetNtopA inet_ntop > > > > should be written: > > #define inet_ntop InetNtopA > > > > same for inet_pton (perhaps others) > > To understand what happens, take a look at these lines: > ``` > #define InetPtonA inet_pton > > WINSOCK_API_LINKAGE INT WSAAPI InetPtonW(INT Family, LPCWSTR pStringBuf, > PVOID pAddr); > WINSOCK_API_LINKAGE INT WSAAPI InetPtonA(INT Family, LPCSTR pStringBuf, > PVOID pAddr); > ``` > > The macro `InetPtonA` precedes both declarations. Hence after > preprocessing, `InetPtonA` on the last line is replaced with > `inet_pton`, resulting in > ``` > WINSOCK_API_LINKAGE INT WSAAPI InetPtonW(INT Family, LPCWSTR pStringBuf, > PVOID pAddr); > WINSOCK_API_LINKAGE INT WSAAPI inet_pton(INT Family, LPCSTR pStringBuf, > PVOID pAddr); > ``` > > And `inet_pton` is exactly declared there.
Ok, my bad. I needed some sleep, then I realized I needed _WIN32_WINNT >= 0x0600.. Thanks all for your help! > > > > > > Or else, where is inet_pton() actually declared? > > > > libws2_32.a or the corresponding DLL, of course. > > > > -- > Best regards, > LH_Mouse > -- Marc-André Lureau _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
