Remove c++0x foreach that mingw gcc doesn't like
Added M_PI define needed on Windows