> On Oct 20, 2016, at 10:48 AM, Alex Kashchenko <akash...@redhat.com> wrote: > > Hi, > > I was building popt-1.13 for windows, it does not work out of the box, but > fixes are straightforward except the following one: > > diff --git a/src/poptint.c b/src/poptint.c > index e99d28b..1b5fd9f 100644 > --- a/src/poptint.c > +++ b/src/poptint.c > @@ -102,7 +102,11 @@ strdup_vprintf (const char *format, va_list ap) > va_copy(apc, ap); /* XXX linux amd64/ppc needs a copy. */ > /*@=noeffectuncon =unrecog @*/ > > +#ifdef _WIN32 > + buffer = calloc(sizeof(*buffer), _vscprintf (format, ap) + 1); > +#elif // !_WIN32 > buffer = calloc(sizeof(*buffer), vsnprintf (&c, 1, format, ap) + 1); > +#endif // _WIN32 > > vsnprintf has non-standard behaviour on windows (does not return the required > size), details [1]. >
Ok. > I understand that windows is not a supported platform for popt (though found > some previous porting efforts [2]), so sharing just for the record. > Current code in CVS is considerably different than what was in popt-1.13 in 2007 FWIW, I compiled/tested post in CVS back in June on Windows10 without serious problems. hth 73 de Jeff > > [1] http://stackoverflow.com/a/8490708/314015 > [2] http://rpm5.org/community/popt-devel/0122.html > > -- > -Alex > ______________________________________________________________________ > POPT Library http://rpm5.org > Developer Communication List popt-devel@rpm5.org ______________________________________________________________________ POPT Library http://rpm5.org Developer Communication List popt-devel@rpm5.org