If anyone wants to build this for win32 with Borland, these patches allow the use of USE_PERLIO and USE_LARGE_FILES.

dosish.h

--- saved\dosish.h Tue Sep 02 14:39:20 2003 +++ dosish.h Thu Sep 25 18:39:09 2003 @@ -83,7 +83,12 @@ * information. */ #if defined(WIN64) || defined(USE_LARGE_FILES) + #if defined(__BORLANDC__) /* buk */ + #include <sys\stat.h> + #define Stat_t struct stati64 + #else #define Stat_t struct _stati64 + #endif #else #if defined(UNDER_CE) #define Stat_t struct xcestat

win32.c

--- ..\saved\win32.c Tue Sep 02 14:42:10 2003 +++ win32.c Thu Sep 25 19:47:45 2003 @@ -2578,10 +2578,14 @@ win32_ftell(FILE *pf) { #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLAND__) /* buk */ + return win32_tell( fileno( pf ) ); +#else fpos_t pos; if (fgetpos(pf, &pos)) return -1; return (Off_t)pos; +#endif #else return ftell(pf); #endif @@ -2591,6 +2595,13 @@ win32_fseek(FILE *pf, Off_t offset,int origin) { #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLANDC__) /* buk */ + return win32_lseek( + fileno(pf), + offset, + origin + ); +#else fpos_t pos; switch (origin) { case SEEK_CUR: @@ -2610,6 +2621,7 @@ return -1; } return fsetpos(pf, &offset); +#endif #else return fseek(pf, offset, origin); #endif @@ -2618,13 +2630,25 @@ DllExport int win32_fgetpos(FILE *pf,fpos_t *p) { +#if defined(__BORLANDC__) && defined(USE_LARGE_FILES) /* buk */ + if( win32_tell(fileno(pf)) == -1L ) { + errno = EBADF; + return -1; + } + return 0; +#else return fgetpos(pf, p); +#endif } DllExport int win32_fsetpos(FILE *pf,const fpos_t *p) { +#if defined(__BORLANDC__) && defined(USE_LARGE_FILES) /* buk */ + return win32_lseek(fileno(pf), *p, SEEK_CUR); +#else return fsetpos(pf, p); +#endif } DllExport void @@ -3157,7 +3181,23 @@ win32_lseek(int fd, Off_t offset, int origin) { #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLANDC__) /* buk */ + LARGE_INTEGER pos; + pos.QuadPart = offset; + pos.LowPart = SetFilePointer( + (HANDLE)_get_osfhandle(fd), + pos.LowPart, + &pos.HighPart, + origin + ); + if (pos.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != +NO_ERROR) { + pos.QuadPart = -1; + } + + return pos.QuadPart; +#else return _lseeki64(fd, offset, origin); +#endif #else return lseek(fd, offset, origin); #endif @@ -3167,7 +3207,24 @@ win32_tell(int fd) { #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLANDC__) /* buk *// + LARGE_INTEGER pos; + pos.QuadPart = 0; + pos.LowPart = SetFilePointer( + (HANDLE)_get_osfhandle(fd), + pos.LowPart, + &pos.HighPart, + FILE_CURRENT + ); + if (pos.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != +NO_ERROR) { + pos.QuadPart = -1; + } + + return pos.QuadPart; + /* return tell(fd); */ +#else return _telli64(fd); +#endif #else return tell(fd); #endif

win32sck.c

--- ..\saved\win32sck.c Tue Sep 02 14:42:10 2003 +++ win32sck.c Thu Sep 25 18:56:05 2003 @@ -497,7 +497,11 @@ int osf; if (!wsock_started || IsWinNT()) { #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLANDC__) /* buk */ + return win32_fstat(fd, sbufptr ); +#else return _fstati64(fd, sbufptr); +#endif #else return fstat(fd, sbufptr); #endif @@ -525,7 +529,11 @@ } } #if defined(WIN64) || defined(USE_LARGE_FILES) +#if defined(__BORLANDC__) /* buk */ + return win32_fstat(fd, sbufptr); +#else return _fstati64(fd, sbufptr); +#endif #else return fstat(fd, sbufptr); #endif

They have been submitted to p5p, but will obviously take sometime to filter into a full release. They don't cause any additional "make test" failures and I believe I've exercised the large file support fairly thoroughly.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.


In reply to Re: 5.8.1 Released! (Win32/Borland patches) by BrowserUk
in thread 5.8.1 Released! by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.