]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
complain about nonexistent directory in wxDir
[wxWidgets.git] / src / common / filename.cpp
index 47d1dcf0a5c4c76136c7a7d8085bccdbd83b65ed..f8d725c52398a976cce5632c783bbf141feac658 100644 (file)
 #include <unistd.h>
 #endif
 
+#ifdef __DJGPP__
+#include <unistd.h>
+#endif
+
 #ifdef __MWERKS__
 #include <stat.h>
 #include <unistd.h>
@@ -1261,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);