+#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-OS/2 platforms and on Windows too
+ // for the GNU compiler
+#if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__)
+ if ( mkdir(wxFNCONV(dirname), perm) != 0 )
+#else // MSW and OS/2
+ if ( mkdir(FNSTRINGCAST wxFNCONV(dirname)) != 0 )
+#endif // !MSW/MSW
+ {
+ wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
+