]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
compilation fixes for !wxUSE_FONTMAP
[wxWidgets.git] / src / common / filename.cpp
index aae38ea3ef4ee4fe02ee62a53131f59e9b40b3c7..f8d725c52398a976cce5632c783bbf141feac658 100644 (file)
 #include <unistd.h>
 #endif
 
+#ifdef __DJGPP__
+#include <unistd.h>
+#endif
+
 #ifdef __MWERKS__
 #include <stat.h>
 #include <unistd.h>
@@ -231,6 +235,15 @@ void wxFileName::Assign(const wxString& volume,
                         const wxString& name,
                         const wxString& ext,
                         wxPathFormat format )
+{
+    SetPath( path, format );
+
+    m_volume = volume;
+    m_ext = ext;
+    m_name = name;
+}
+
+void wxFileName::SetPath( const wxString &path, wxPathFormat format )
 {
     wxPathFormat my_format = GetFormat( format );
     wxString my_path = path;
@@ -297,10 +310,10 @@ void wxFileName::Assign(const wxString& volume,
             }
         }
     }
-
-    m_volume = volume;
-    m_ext = ext;
-    m_name = name;
+    else
+    {
+        m_relative = TRUE;
+    }
 }
 
 void wxFileName::Assign(const wxString& fullpath,
@@ -1252,19 +1265,17 @@ wxString wxFileName::GetLongPath() const
     if ( !s_triedToLoad )
     {
         s_triedToLoad = TRUE;
-        wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32"));
-        if ( dllKernel )
+        wxDynamicLibrary dllKernel(_T("kernel32"));
+        if ( dllKernel.IsLoaded() )
         {
             // may succeed or fail depending on the Windows version
             static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL;
 #ifdef _UNICODE
-            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameW"));
+            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameW"));
 #else
-            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameA"));
+            s_pfnGetLongPathName = (GET_LONG_PATH_NAME) dllKernel.GetSymbol(_T("GetLongPathNameA"));
 #endif
 
-            wxDllLoader::UnloadLibrary(dllKernel);
-
             if ( s_pfnGetLongPathName )
             {
                 DWORD dwSize = (*s_pfnGetLongPathName)(path, NULL, 0);