This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Tue, 17 Feb 2004 22:37:52 +0000 (22:37 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 17 Feb 2004 22:37:52 +0000 (22:37 +0000)
[ 21989]
From: "Nigel Sandever" <njsandever@hotmail.com>
Subject: [PATCH] 5.8.1 / bcc55 / win32 / Enable PerlIO and/ or USE_LARGE_FILES
Message-ID: <Law9-F94BdsnvUFcxT500000ea5@hotmail.com>
Date: Thu, 25 Sep 2003 21:49:07 +0000

[ 21990]
Fix a little syntax error, reported by Marcus Holland-Moritz

[ 22287]
Subject: Re: [PATCH] Add "Camel" logo icon to perl.exe on Windows
From: Greg Matheson <lang@ms.chinmin.edu.tw>
Date: Mon, 2 Feb 2004 16:52:44 +0800
Message-ID: <20040202165244.A17415@ms.chinmin.edu.tw>
p4raw-link: @22287 on //depot/perl: 986f8adc220317ecfcf2c0eace5110e18382f196
p4raw-link: @21990 on //depot/perl: 05e23382578645af97ac24028ac1e015aa95cf1d
p4raw-link: @21989 on //depot/perl: a810272a6ed1d575996a7f738dfe73d9ccdf15d5

p4raw-id: //depot/maint-5.8/perl@22324
p4raw-integrated: from //depot/perl@22296 'merge in' win32/win32sck.c
(@19537..) dosish.h (@21433..)
p4raw-integrated: from //depot/perl@22287 'merge in' win32/makefile.mk
(@22221..)
p4raw-integrated: from //depot/perl@21989 'edit in' win32/win32.c
(@20572..)

dosish.h
win32/makefile.mk
win32/win32.c
win32/win32sck.c

index 21a0c59..abf9432 100644 (file)
--- a/dosish.h
+++ b/dosish.h
  *     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
index d8575e8..cd869e0 100644 (file)
@@ -403,7 +403,7 @@ LINK32              = g++
 .END
 LIB32          = ar rc
 IMPLIB         = dlltool
-RSC            = rc
+RSC            = windres
 
 i = .i
 o = .o
@@ -573,7 +573,7 @@ $(o).dll:
 .ENDIF
 
 .rc.res:
-       $(RSC) -i.. $<
+       $(RSC) -i $< -o $@
 
 #
 # various targets
@@ -1043,10 +1043,10 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
 .ENDIF
        $(XCOPY) $(PERLIMPLIB) $(COREDIR)
 
-$(PERLEXE_ICO): $(MINIPERL) makeico.pl
+.\$(PERLEXE_ICO): $(MINIPERL) makeico.pl
        $(MINIPERL) makeico.pl > $@
 
-$(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
+.\$(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
 
 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
        cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
index d532ee9..69b0ca2 100644 (file)
@@ -2578,10 +2578,14 @@ DllExport Off_t
 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 @@ DllExport int
 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 @@ win32_fseek(FILE *pf, Off_t offset,int origin)
        return -1;
     }
     return fsetpos(pf, &offset);
+#endif
 #else
     return fseek(pf, offset, origin);
 #endif
@@ -2618,13 +2630,25 @@ win32_fseek(FILE *pf, Off_t offset,int origin)
 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 @@ DllExport Off_t
 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 @@ DllExport Off_t
 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
index 45c2102..9f47f50 100644 (file)
@@ -497,7 +497,11 @@ my_fstat(int fd, Stat_t *sbufptr)
     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 @@ my_fstat(int fd, Stat_t *sbufptr)
        }
     }
 #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