]> git.saurik.com Git - wxWidgets.git/commitdiff
OS/2 patch
authorDavid Webster <Dave.Webster@bhmi.com>
Fri, 10 Mar 2000 13:56:17 +0000 (13:56 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Fri, 10 Mar 2000 13:56:17 +0000 (13:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cmndata.cpp
src/common/filefn.cpp
src/common/object.cpp

index 13191c1ee927b79208b4ad8332e8b8bea4e7ccff..2e612f6ad577ca7dd8c9312746c065194c69b37b 100644 (file)
@@ -40,7 +40,7 @@
 #include "wx/log.h"
 
 // For compatibility
-#if (defined(__WXMOTIF__) || defined(__WXGTK__)) && wxUSE_POSTSCRIPT
+#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
     #define wxCOMPATIBILITY_WITH_PRINTSETUPDATA 1
 #endif
 
index 9cea28b83a58b488b6a00be4fdd44084cc943cd2..2a1694b0a731c87674c485fc9cbae22a46d0bf48 100644 (file)
@@ -132,7 +132,7 @@ static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN];
 
 #if defined(__VISAGECPP__) && __IBMCPP__ >= 400
 //
-// VisualAge C++ V4.0 cannot have any external linkage const decs 
+// VisualAge C++ V4.0 cannot have any external linkage const decs
 // in headers included by more than one primary source
 //
 const off_t wxInvalidOffset = (off_t)-1;
@@ -1311,7 +1311,7 @@ wxString wxFindNextFile()
           nextDir = readdir(gs_dirStream) )
     {
         if (wxMatchWild(name, nextDir->d_name, FALSE) &&   // RR: added FALSE to find hidden files
-           strcmp(nextDir->d_name, ".") && 
+           strcmp(nextDir->d_name, ".") &&
            strcmp(nextDir->d_name, "..") )
         {
             result.Empty();
@@ -1416,7 +1416,7 @@ wxString wxFindNextFile()
                        
                if ( ( g_iter.m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(g_iter_flags & wxFILE ) )
                        continue ;
-                        
+                       
                // hit !
                break ;
        }
@@ -1430,7 +1430,7 @@ wxString wxFindNextFile()
                                                                   g_iter.m_dirId,
                                                                   g_iter.m_name,
                                                                   &spec) ;
-                                                                 
+                                                               
        return wxMacFSSpec2UnixFilename( &spec ) ;
 }
 
@@ -1524,6 +1524,7 @@ wxString wxFindFirstFile(const wxChar *spec, int flags)
     return result;
 }
 
+
 wxString wxFindNextFile()
 {
     wxString result;
@@ -1595,7 +1596,51 @@ try_again:
     return result;
 }
 
-#endif // Unix/Windows
+#elif defined(__WXPM__)
+
+wxString wxFindFirstFile(const wxChar *spec, int flags)
+{
+    wxString result;
+
+    /*
+    // TODO: figure something out here for OS/2
+    gs_strFileSpec = spec;
+    gs_findFlags = flags;
+
+    // Find path only so we can concatenate found file onto path
+    wxString path(wxPathOnly(gs_strFileSpec));
+    if ( !path.IsEmpty() )
+        result << path << wxT('\\');
+
+    int flag = _A_NORMAL;
+    if (flags & wxDIR)
+        flag = _A_SUBDIR;
+
+    if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
+    {
+        char attrib;
+        attrib = gs_findDataStruct.attrib;
+
+        if (attrib & _A_SUBDIR) {
+            if (!(gs_findFlags & wxDIR))
+                return wxFindNextFile();
+        } else if (gs_findFlags && !(gs_findFlags & wxFILE))
+            return wxFindNextFile();
+
+        result += gs_findDataStruct.name;
+    }
+    */
+    return result;
+}
+
+wxString wxFindNextFile()
+{
+    wxString result;
+    // TODO:
+    return result;
+}
+
+#endif // Unix/Windows/OS/2
 
 // Get current working directory.
 // If buf is NULL, allocates space using new, else
@@ -1627,9 +1672,9 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
 #ifdef _MSC_VER
   if (_getcwd(buf, sz) == NULL) {
 #elif defined( __WXMAC__)
-       enum 
-       { 
-               SFSaveDisk = 0x214, CurDirStore = 0x398 
+       enum
+       {
+               SFSaveDisk = 0x214, CurDirStore = 0x398
        };
        FSSpec cwdSpec ;
        
index 857d89a0da4d89b4875364b9c0432a8981d9f99d..30f1f605cfe0d5b1e102f9146a6f8c79f038166f 100644 (file)
@@ -375,9 +375,18 @@ void wxObject::UnRef()
         wxASSERT_MSG( m_refData->m_count > 0, _T("invalid ref data count") );
 
         if ( !--m_refData->m_count )
+#if defined(__VISAGECPP__) && IBMCPP < 400
+            //
+            // don't know what is going on with VA 3.0 but its got some memory problems here
+            // this delete causes a trap in CPPOOM3.DLL
+            //
+            {
+            }
+#else
             delete m_refData;
 
         m_refData = (wxObjectRefData *) NULL;
+#endif
     }
 }