+#if defined( __WXMAC__ )
+ wxStrcpy( gwxMacFileName , dir ) ;
+ wxUnix2MacFilename( gwxMacFileName ) ;
+ 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__)) || defined(__WXWINE__)
+ if ( mkdir(wxFNCONV(dirname), perm) != 0 )
+#else // MSW
+ if ( mkdir(wxFNCONV(dirname)) != 0 )
+#endif // !MSW/MSW
+ {
+ wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
+