diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index 9984d8d8e4..6f5a05bd23 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -51,7 +51,6 @@ wxString WXDLLIMPEXP_CORE wxMacMakeStringFromPascal( const unsigned char * from WXDLLIMPEXP_BASE wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent = NULL ); WXDLLIMPEXP_BASE OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef ); WXDLLIMPEXP_BASE wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ); -WXDLLIMPEXP_BASE CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path); // keycode utils from app.cpp @@ -60,6 +59,8 @@ WXDLLIMPEXP_BASE long wxMacTranslateKey(unsigned char key, unsigned char code); #endif +WXDLLIMPEXP_BASE CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path); + #if wxUSE_GUI #if wxOSX_USE_IPHONE diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 51ac27ade9..ce25de9ebc 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -796,7 +796,16 @@ wxString wxPathOnly (const wxString& path) // and back again - or we get nasty problems with delimiters. // Also, convert to lower case, since case is significant in UNIX. -#if defined(__WXMAC__) && !defined(__WXOSX_IPHONE__) +#ifdef __WXOSX__ + +CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path) +{ + wxCFRef cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path))); + CFStringNormalize(cfMutableString,kCFStringNormalizationFormD); + return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false); +} + +#ifndef __WXOSX_IPHONE__ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent ) { @@ -842,13 +851,6 @@ wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ) return wxCFStringRef::AsStringWithNormalizationFormC(cfname); } -CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path) -{ - wxCFRef cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path))); - CFStringNormalize(cfMutableString,kCFStringNormalizationFormD); - return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false); -} - #ifndef __LP64__ wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) @@ -871,6 +873,8 @@ void wxMacFilename2FSSpec( const wxString& path , FSSpec *spec ) } #endif +#endif // !__WXOSX_IPHONE__ + #endif // __WXMAC__