- const char *dirname = gwxMacFileName;
-#else
- const char *dirname = dir.c_str();
-#endif
-
- if ( mkdir(dirname, perm) != 0 )
+ const wxChar *dirname = gwxMacFileName;
+#else // !Mac
+ const wxChar *dirname = dir.c_str();
+#endif // Mac/!Mac
+
+ // assume mkdir() has 2 args on non Windows platforms and on Windows too
+ // for the GNU compiler
+#if !defined(__WXMSW__) || (defined(__GNUWIN32__) && !defined(__MINGW32__))
+ if ( mkdir(wxFNCONV(dirname), perm) != 0 )
+#else // MSW
+ if ( mkdir(wxFNCONV(dirname)) != 0 )
+#endif // !MSW/MSW