fix building with visual studio

some preprocessor magic to get dllimport/dllexport right