backport to win32 (MSVC, CodeLite-cygwin) and win64 (CodeLite-mingw64)