Small patch for windows platform

Hello Ken,

Here is a small patch to support windows platform. Explanation in the code text.

Cheers,
Sylvain