On Wed, Aug 06, 2014 at 07:31:04PM +0400, Ivan Zhakov wrote:
> apr_get_os_error() uses GetLastError() on Windows, while strtol() uses
> standard errno for error code.
So you're saying code like this works on Windows, and I shouldn't
be using apr_get/set_os_error() for strtol()?
errno = 0;
lval = strtol(buf, &ep, 10);
if (buf[0] == '\0' || *ep != '\0')
goto not_a_number;
if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) ||
(lval > INT_MAX || lval < INT_MIN))
goto out_of_range;
ival = lval;