Mingw32 compilation changes

These are changes that allow code and codemp to be built with mingw/gcc - see readme for instructions.  A small amount of defines/code are copied from wine headers - this is noted in the source along with the file(s) copied from and noting the wine licence (LGPL).