Initial work for mingw support ( @DDuarte)
based on https://github.com/TrinityCore/TrinityCore/commit/c7463c5f6cd3d882a960eff2cbd414f33ddf0b32