> Out of curiosity, why did you prefer this:
>
> +#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN__))
> +void normalize_for_lf (string &fn)
> +{
> + int fnlen = fn.length();
> + for (int i = 0; i < fnlen; i++) {
> + if (fn[i] == '\\')
> + fn[i] = '/';
> + }
> +}
> +#else
> +void normalize_for_lf (string &)
> +{
> +}
> +#endif
>
> to my original change:
>
> +void normalize_for_lf (string &fn)
> +{
> +#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN__))
> + int fnlen = fn.length();
> + for (int i = 0; i < fnlen; i++)
> + {
> + if (fn[i] == '\\')
> + fn[i] = '/';
> + }
> +#endif
> +}
With your version, I get a warning about an unused variable `fn' if
not compiling for MS. The standard C++ solution to suppress this
warning is to simply omit the parameter's name in the function's
signature, and exactly this I've done in my version.
Werner