> On Oct 20, 2016, at 10:48 AM, Alex Kashchenko <firstname.lastname@example.org> wrote:
> 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 .
> I understand that windows is not a supported platform for popt (though found some previous porting efforts ), 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.
73 de Jeff
>  http://stackoverflow.com/a/8490708/314015
>  http://rpm5.org/community/popt-devel/0122.html
> POPT Library http://rpm5.org
> Developer Communication List email@example.com
Received on Thu Oct 20 18:25:50 2016