buildfix g++: removed unneeded windows header and made fixed variable scope