Subject: Re: c-ares not compiling with mingw32ce

Re: c-ares not compiling with mingw32ce

From: Vincent Torri <vincent.torri_at_gmail.com>
Date: Tue, 22 Mar 2011 18:36:44 +0100

On Tue, Mar 22, 2011 at 3:01 PM, Yang Tse <yangsita_at_gmail.com> wrote:

> 2011/3/22 Vincent Torri wrote:
>
> >> Vincent, please try today's changes. If I build a hand crafted
> >> config-win32ce.h, would you be able to test it using a non-configure
> >> compiler setup?
> >
> > Actually, I'm only cross-compiling with cegcc. I have no Microsoft tool
> for
> > Windows CE. If I'm not mistaken, it's not free like Visual Studio
> Express.
>
> Ok, don't worry. Anyway, It would be useful to verify a couple of
> things from the ares_config.h generated on your system. It would be
> nice if you could attach it when you re-run buildconf and configure
> with current repository version (or simply configure with tonight's
> snapshot).
>

with current repo:

ares_gethostbyaddr.c:222: error: 'ENOENT' undeclared (first use in this
function)
ares_gethostbyaddr.c:222: error: (Each undeclared identifier is reported
only once
ares_gethostbyaddr.c:222: error: for each function it appears in.)
ares_gethostbyaddr.c:223: error: 'ESRCH' undeclared (first use in this
function)

I think that it's not the only place where fopen() returned value is used. I
don't know what to do here (I don't know the code...)

Also the mode used by fopen should always be in binary mode ("rb", "wb"). On
Unix, 'b' is ignored, but on Windows, it's important to have it:

ares_gethostbyaddr.c: fp = fopen(PATH_HOSTS, "r");
ares_gethostbyname.c: fp = fopen(PATH_HOSTS, "r")
ares_init.c: fp = fopen(PATH_RESOLV_CONF, "r");
ares_init.c: fp = fopen("/etc/nsswitch.conf", "r");
ares_init.c: fp = fopen("/etc/host.conf", "r");
ares_init.c: fp = fopen("/etc/svc.conf", "r");
ares_search.c: fp = fopen(hostaliases, "r");

Vincent Torri
Received on 2011-03-22