]> git.saurik.com Git - wxWidgets.git/commitdiff
off_t --> wxFileOffset changes
authorRobin Dunn <robin@alldunn.com>
Wed, 29 Sep 2004 16:42:36 +0000 (16:42 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 29 Sep 2004 16:42:36 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/include/wx/wxPython/pyistream.h
wxPython/src/helpers.cpp

index ef1941b5576631f829e4aaa3d875cc7473d1da5e..793315adafdb06437e9244df8c9d546ea6a573f0 100644 (file)
@@ -81,8 +81,8 @@ protected:
     // wxStreamBase methods
     virtual size_t OnSysRead(void *buffer, size_t bufsize);
     virtual size_t OnSysWrite(const void *buffer, size_t bufsize);
-    virtual off_t OnSysSeek(off_t off, wxSeekMode mode);
-    virtual off_t OnSysTell() const;
+    virtual wxFileOffset OnSysSeek(wxFileOffset off, wxSeekMode mode);
+    virtual wxFileOffset OnSysTell() const;
 
     // helper
     static PyObject* getMethod(PyObject* py, char* name);
index f411f31ee8bf4f2a55f49e786edf2c89be23cacf..a17498e3045f09e9dcbae400381cfc6817d4a8cf 100644 (file)
@@ -1385,8 +1385,8 @@ PyObject* wxPyCBInputStream::getMethod(PyObject* py, char* name) {
 size_t wxPyCBInputStream::GetSize() const {
     wxPyCBInputStream* self = (wxPyCBInputStream*)this; // cast off const
     if (m_seek && m_tell) {
-        off_t temp = self->OnSysTell();
-        off_t ret = self->OnSysSeek(0, wxFromEnd);
+        wxFileOffset temp = self->OnSysTell();
+        wxFileOffset ret = self->OnSysSeek(0, wxFromEnd);
         self->OnSysSeek(temp, wxFromStart);
         return ret;
     }
@@ -1426,10 +1426,10 @@ size_t wxPyCBInputStream::OnSysWrite(const void *buffer, size_t bufsize) {
     return 0;
 }
 
-off_t wxPyCBInputStream::OnSysSeek(off_t off, wxSeekMode mode) {
+wxFileOffset wxPyCBInputStream::OnSysSeek(wxFileOffset off, wxSeekMode mode) {
     bool blocked = wxPyBeginBlockThreads();
-#ifdef _LARGE_FILES
-    // off_t is a 64-bit value...
+#if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED)
+    // wxFileOffset is a 64-bit value...
     PyObject* arglist = Py_BuildValue("(Li)", off, mode);
 #else
     PyObject* arglist = Py_BuildValue("(ii)", off, mode);
@@ -1442,14 +1442,14 @@ off_t wxPyCBInputStream::OnSysSeek(off_t off, wxSeekMode mode) {
 }
 
 
-off_t wxPyCBInputStream::OnSysTell() const {
+wxFileOffset wxPyCBInputStream::OnSysTell() const {
     bool blocked = wxPyBeginBlockThreads();
     PyObject* arglist = Py_BuildValue("()");
     PyObject* result = PyEval_CallObject(m_tell, arglist);
     Py_DECREF(arglist);
-    off_t o = 0;
+    wxFileOffset o = 0;
     if (result != NULL) {
-#ifdef _LARGE_FILES
+#if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED)
         if (PyLong_Check(result))
             o = PyLong_AsLongLong(result);
         else