On mingw, gai_strerror has two different return types, depending on whether UNICODE was defined at the time the header was included. Both types (char* and WCHAR*) are incompatible with the POSIX return type of const char*. Furthermore, a WCHAR* return renders the return string worthless for an application that is not expecting unicode (you'd get one byte). It doesn't help that on mingw, gai_strerror is declared as an inline function in the header, rather than declared as a function with external linkage.
Should we always be replacing gai_strerror on mingw, and having the replacement call gai_strerrorA to guarantee ASCII results and the right return type? Noticed by Matthias Bolte as a build warning of libvirt on mingw: test-getaddrinfo.c:28:1: warning: initialization from incompatible pointer type -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature