Unix compatibility

Done a lot of modifications in order to be able to compile under linux with gcc and clang. Hope it won't disturb, it mainly contains some #ifdef _WIN32 and some LPCSTR to const char* replacements.