]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
a micro bug (but which was enough to break regtest sample) corrected
[wxWidgets.git] / src / common / filefn.cpp
index c146f4ec4c97c6aa0b830b42cf9aa9b6c45c3d66..cb4b81d8180a0354f89f2a4bbf88dce2c8a40cb0 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include "wx/utils.h"
+#include <wx/intl.h>
 
 #include <ctype.h>
 #include <stdio.h>
@@ -45,7 +46,7 @@
 #include <dirent.h>
 #endif
 
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
 #ifndef __GNUWIN32__
 #include <direct.h>
 #include <dos.h>
@@ -69,7 +70,7 @@
 #include <dir.h>
 #endif
 
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
 #include "windows.h"
 #endif
 
@@ -90,7 +91,7 @@ void wxPathList::Add (const wxString& path)
 void wxPathList::AddEnvList (const wxString& envVariable)
 {
   static const char PATH_TOKS[] =
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
        " ;"; // Don't seperate with colon in DOS (used for drive)
 #else
        " :;";
@@ -135,7 +136,7 @@ bool wxPathList::Member (const wxString& path)
   {
       wxString path2((char *) node->Data ());
       if (
-#if defined(__WXMSW__) || defined(__VMS__)
+#if defined(__WINDOWS__) || defined(__VMS__)
       // Case INDEPENDENT
          path.CompareTo (path2, wxString::ignoreCase) == 0
 #else
@@ -166,7 +167,7 @@ wxString wxPathList::FindValidPath (const wxString& file)
       if (ch != '\\' && ch != '/')
         strcat (wxBuffer, "/");
       strcat (wxBuffer, filename);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
       Unix2DosFilename (wxBuffer);
 #endif
       if (wxFileExists (wxBuffer))
@@ -193,7 +194,7 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
       lastCh = buf[len-1];
     if (lastCh != '/' && lastCh != '\\')
     {
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
       strcat(buf, "\\");
 #else
       strcat(buf, "/");
@@ -236,7 +237,7 @@ wxIsAbsolutePath (const wxString& filename)
 #ifdef __VMS__
       || (filename[0] == '[' && filename[1] != '.')
 #endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
       /* MSDOS */
       || filename[0] == '\\' || (isalpha (filename[0]) && filename[1] == ':')
 #endif
@@ -736,7 +737,11 @@ wxDos2UnixFilename (char *s)
 }
 
 void 
+#ifdef __WXMSW__
 wxUnix2DosFilename (char *s)
+#else
+wxUnix2DosFilename (char *WXUNUSED(s))
+#endif
 {
 // Yes, I really mean this to happen under DOS only! JACS
 #ifdef __WXMSW__
@@ -839,7 +844,9 @@ bool wxRemoveFile(const wxString& file)
 
 bool wxMkdir(const wxString& dir)
 {
-#ifdef __VMS__
+#if defined(__WXSTUBS__)
+  return FALSE;
+#elif defined(__VMS__)
        return FALSE;
 #elif (defined(__GNUWIN32__) && !defined(__MINGW32__)) || !defined(__WXMSW__)
   return (mkdir (WXSTRINGCAST dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
@@ -919,7 +926,7 @@ bool wxPathExists(const char *pszPathName)
 // Get a temporary filename, opening and closing the file.
 char *wxGetTempFileName(const wxString& prefix, char *buf)
 {
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
 
 #ifndef        __WIN32__
   char tmp[144];
@@ -956,7 +963,7 @@ char *wxGetTempFileName(const wxString& prefix, char *buf)
          return buf;
        }
     }
-  cerr << "wxWindows: error finding temporary file name.\n";
+  cerr << _("wxWindows: error finding temporary file name.\n");
   if (buf) buf[0] = 0;
   return NULL;
 #endif
@@ -1255,7 +1262,7 @@ bool wxSetWorkingDirectory(const wxString& d)
 {
 #ifdef __UNIX__
   return (chdir(d) == 0);
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
 
 #ifdef __WIN32__
   return (bool)(SetCurrentDirectory(d) != 0);
@@ -1300,7 +1307,7 @@ bool wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile)
 {
   // we assume that it's not empty
   wxCHECK_MSG( !IsEmpty(pszFile), FALSE, 
-               "empty file name in wxFindFileInPath");
+               _("empty file name in wxFindFileInPath"));
 
   // skip path separator in the beginning of the file name if present
   if ( wxIsPathSeparator(*pszFile) )
@@ -1335,7 +1342,7 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName,
                              wxString *pstrName,
                              wxString *pstrExt)
 {
-  wxCHECK_RET( pszFileName, "NULL file name in wxSplitPath" );
+  wxCHECK_RET( pszFileName, _("NULL file name in wxSplitPath") );
 
   const char *pDot = strrchr(pszFileName, FILE_SEP_EXT);
   const char *pSepUnix = strrchr(pszFileName, FILE_SEP_PATH_UNIX);
@@ -1346,7 +1353,7 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName,
   uint nPosDos = pSepDos ? pSepDos - pszFileName : 0;
   if ( nPosDos > nPosUnix )
     nPosUnix = nPosDos;
-  uint nLen = Strlen(pszFileName);
+//  uint nLen = Strlen(pszFileName);
 
   if ( pstrPath )
     *pstrPath = wxString(pszFileName, nPosUnix);