]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/_PDCLIB_seek.c
Inlined some of the Cygwin patches. Not nice, but useful as I keep switching platforms.
[pdclib] / platform / example / functions / _PDCLIB / _PDCLIB_seek.c
index cafcee8ddc2cfd64db234c335ca00e9754667321..8c600f6790f969e2b5a4d4356b5d780691b6cc09 100644 (file)
@@ -13,6 +13,7 @@
 #include "/usr/include/errno.h"
 
 extern _PDCLIB_int64_t lseek64( int fd, _PDCLIB_int64_t offset, int whence );
+extern long lseek( int fd, long offset, int whence );
 
 _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence )
 {
@@ -31,7 +32,11 @@ _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t of
             return EOF;
             break;
     }
+#ifdef __CYGWIN__
+    _PDCLIB_int64_t rc = lseek( stream->handle, offset, whence );
+#else
     _PDCLIB_int64_t rc = lseek64( stream->handle, offset, whence );
+#endif
     if ( rc != EOF )
     {
         stream->ungetidx = 0;