]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
Some things needed in the base class of OS/2
[wxWidgets.git] / src / common / filename.cpp
index f8d725c52398a976cce5632c783bbf141feac658..5c2f9b007c215bf932e347a4b0ae148284138c41 100644 (file)
 #include "wx/msw/winundef.h"
 #endif
 
+#if defined(__WXMAC__)
+  #include  "wx/mac/private.h"  // includes mac headers
+#endif
+
 // utime() is POSIX so should normally be available on all Unices
 #ifdef __UNIX_LIKE__
 #include <sys/types.h>
@@ -537,8 +541,11 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
 #else // !Windows, !OS/2
     if ( dir.empty() )
     {
+#if defined(__WXMAC__) && !defined(__DARWIN__)
+        dir = wxMacFindFolder(  (short) kOnSystemDisk, pTemporaryFolder, kCreateFolder ) ;
+#else // !Mac
         dir = wxGetenv(_T("TMP"));
-        if ( path.empty() )
+        if ( dir.empty() )
         {
             dir = wxGetenv(_T("TEMP"));
         }
@@ -547,11 +554,12 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
         {
             // default
             #ifdef __DOS__
-            dir = _T(".");
+                dir = _T(".");
             #else
-            dir = _T("/tmp");
+                dir = _T("/tmp");
             #endif
         }
+#endif // Mac/!Mac
     }
 
     path = dir;