+#if defined(__WXMAC__)
+
+#if TARGET_API_MAC_OSX
+#define kDefaultPathStyle kCFURLPOSIXPathStyle
+#else
+#define kDefaultPathStyle kCFURLHFSPathStyle
+#endif
+
+wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent )
+{
+ CFURLRef fullURLRef;
+ fullURLRef = CFURLCreateFromFSRef(NULL, fsRef);
+ if ( additionalPathComponent )
+ {
+ CFURLRef parentURLRef = fullURLRef ;
+ fullURLRef = CFURLCreateCopyAppendingPathComponent(NULL, parentURLRef,
+ additionalPathComponent,false);
+ CFRelease( parentURLRef ) ;
+ }
+ CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, kDefaultPathStyle);
+ CFRelease( fullURLRef ) ;
+ return wxMacCFStringHolder(cfString).AsString(wxLocale::GetSystemEncoding());
+}
+
+OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
+{
+ OSStatus err = noErr ;
+ CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, wxMacCFStringHolder(path ,wxLocale::GetSystemEncoding() ) , kDefaultPathStyle, false);
+ if ( NULL != url )
+ {
+ if ( CFURLGetFSRef(url, fsRef) == false )
+ err = fnfErr ;
+ CFRelease( url ) ;
+ }
+ else
+ {
+ err = fnfErr ;
+ }
+ return err ;
+}
+
+wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname )
+{
+ CFStringRef cfname = CFStringCreateWithCharacters( kCFAllocatorDefault,
+ uniname->unicode,
+ uniname->length );
+ return wxMacCFStringHolder(cfname).AsString() ;
+}
+
+wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
+{
+ FSRef fsRef ;
+ if ( FSpMakeFSRef( spec , &fsRef) == noErr )
+ {
+ return wxMacFSRefToPath( &fsRef ) ;
+ }
+ return wxEmptyString ;
+}
+
+void wxMacFilename2FSSpec( const wxString& path , FSSpec *spec )
+{
+ OSStatus err = noErr ;
+ FSRef fsRef ;
+ wxMacPathToFSRef( path , &fsRef ) ;
+ err = FSRefMakeFSSpec( &fsRef , spec ) ;
+}
+
+#endif // __WXMAC__
+
+void
+wxDos2UnixFilename (wxChar *s)