making code compiles and work on mingw 32 bit on versions 4.7.x and 4.8.x (nw)