This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
win32: remove support for disabling USE_LARGE_FILES
authorTomasz Konojacki <me@xenu.pl>
Thu, 29 Oct 2020 17:58:10 +0000 (18:58 +0100)
committerKarl Williamson <khw@cpan.org>
Mon, 23 Nov 2020 03:19:06 +0000 (20:19 -0700)
It was enabled by default on all compilers. I don't think it ever
makes sense to disable it.

dosish.h
win32/GNUmakefile
win32/Makefile
win32/config.gc
win32/config.vc
win32/config_H.gc
win32/config_H.vc
win32/config_sh.PL
win32/makefile.mk
win32/win32.c

index 5b27160..1860a0f 100644 (file)
--- a/dosish.h
+++ b/dosish.h
  *     to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
  *     information.
  */
-#if defined(WIN64) || defined(USE_LARGE_FILES)
-#  define Stat_t struct _stati64
-#else
-#  define Stat_t struct stat
-#endif
+#define Stat_t struct _stati64
 
 /* USE_STAT_RDEV:
  *     This symbol is defined if this system has a stat structure declaring
index 7c45d00..084cb50 100644 (file)
@@ -116,13 +116,6 @@ USE_IMP_SYS        := define
 USE_PERLIO     := define
 
 #
-# Comment this out if you don't want to enable large file support for
-# some reason.  Should normally only be changed to maintain compatibility
-# with an older release of perl.
-#
-USE_LARGE_FILES        := define
-
-#
 # Uncomment this if you're building a 32-bit perl and want 64-bit integers.
 # (If you're building a 64-bit perl then you will have 64-bit integers whether
 # or not this is uncommented.)
@@ -1213,7 +1206,6 @@ CFG_VARS  =                                       \
                "useperlio=$(USE_PERLIO)"               \
                "use64bitint=$(USE_64_BIT_INT)"         \
                "uselongdouble=$(USE_LONG_DOUBLE)"      \
-               "uselargefiles=$(USE_LARGE_FILES)"      \
                "usesitecustomize=$(USE_SITECUST)"      \
                "default_inc_excludes_dot=$(DEFAULT_INC_EXCLUDES_DOT)"  \
                "LINK_FLAGS=$(subst ",\",$(LINK_FLAGS))"\
@@ -1331,9 +1323,6 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
        @(echo.&& \
        echo #ifndef _config_h_footer_&& \
        echo #define _config_h_footer_&& \
-       echo #undef Off_t&& \
-       echo #undef LSEEKSIZE&& \
-       echo #undef Off_t_size&& \
        echo #undef PTRSIZE&& \
        echo #undef SSize_t&& \
        echo #undef HAS_ATOLL&& \
@@ -1403,15 +1392,6 @@ else ifeq ($(CCTYPE),MSVC142)
        echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
        echo #define I_STDBOOL)>> config.h
 endif
-ifeq ($(USE_LARGE_FILES),define)
-       @(echo #define Off_t $(INT64)&& \
-       echo #define LSEEKSIZE ^8&& \
-       echo #define Off_t_size ^8)>> config.h
-else
-       @(echo #define Off_t long&& \
-       echo #define LSEEKSIZE ^4&& \
-       echo #define Off_t_size ^4)>> config.h
-endif
 ifeq ($(WIN64),define)
 ifeq ($(CCTYPE),GCC)
        @(echo #define LONG_DOUBLESIZE ^16)>> config.h
index ecbfd7a..93d55f7 100644 (file)
@@ -81,13 +81,6 @@ USE_ITHREADS = define
 USE_IMP_SYS    = define
 
 #
-# Comment this out if you don't want to enable large file support for
-# some reason.  Should normally only be changed to maintain compatibility
-# with an older release of perl.
-#
-USE_LARGE_FILES        = define
-
-#
 # Uncomment this if you're building a 32-bit perl and want 64-bit integers.
 # (If you're building a 64-bit perl then you will have 64-bit integers whether
 # or not this is uncommented.)
@@ -296,10 +289,6 @@ USE_ITHREADS       = undef
 USE_IMP_SYS    = undef
 !ENDIF
 
-!IF "$(USE_LARGE_FILES)" == ""
-USE_LARGE_FILES        = undef
-!ENDIF
-
 !IF "$(USE_64_BIT_INT)" == ""
 USE_64_BIT_INT = undef
 !ENDIF
@@ -915,7 +904,6 @@ CFG_VARS    =                                       \
                "usemultiplicity=$(USE_MULTI)"          \
                "use64bitint=$(USE_64_BIT_INT)"         \
                "uselongdouble=undef"                   \
-               "uselargefiles=$(USE_LARGE_FILES)"      \
                "usesitecustomize=$(USE_SITECUST)"      \
                "default_inc_excludes_dot=$(DEFAULT_INC_EXCLUDES_DOT)"  \
                "LINK_FLAGS=$(LINK_FLAGS:"=\")"         \
@@ -1007,9 +995,6 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
        @(echo.&& \
        echo #ifndef _config_h_footer_&& \
        echo #define _config_h_footer_&& \
-       echo #undef Off_t&& \
-       echo #undef LSEEKSIZE&& \
-       echo #undef Off_t_size&& \
        echo #undef PTRSIZE&& \
        echo #undef SSize_t&& \
        echo #undef HAS_ATOLL&& \
@@ -1041,15 +1026,6 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
        echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
        echo #define I_STDBOOL)>> config.h
 !ENDIF
-!IF "$(USE_LARGE_FILES)"=="define"
-       @(echo #define Off_t $(INT64)&& \
-       echo #define LSEEKSIZE ^8&& \
-       echo #define Off_t_size ^8)>> config.h
-!ELSE
-       @(echo #define Off_t long&& \
-       echo #define LSEEKSIZE ^4&& \
-       echo #define Off_t_size ^4)>> config.h
-!ENDIF
 !IF "$(WIN64)"=="define"
        @(echo #define PTRSIZE ^8&& \
        echo #define SSize_t $(INT64)&& \
index b0af7d4..c632ba9 100644 (file)
@@ -888,8 +888,8 @@ longsize='4'
 lp=''
 lpr=''
 ls='dir'
-lseeksize='4'
-lseektype='long'
+lseeksize='8'
+lseektype='long long'
 mad='undef'
 mail=''
 mailx=''
@@ -1126,7 +1126,7 @@ usedtrace='undef'
 usefaststdio='undef'
 useithreads='undef'
 usekernprocpathname='undef'
-uselargefiles='undef'
+uselargefiles='define'
 uselongdouble='undef'
 usemallocwrap='define'
 usemorebits='undef'
index 234de8d..3f68e75 100644 (file)
@@ -887,8 +887,8 @@ longsize='4'
 lp=''
 lpr=''
 ls='dir'
-lseeksize='4'
-lseektype='long'
+lseeksize='8'
+lseektype='__int64'
 mad='undef'
 mail=''
 mailx=''
@@ -1125,7 +1125,7 @@ usedtrace='undef'
 usefaststdio='undef'
 useithreads='undef'
 usekernprocpathname='undef'
-uselargefiles='undef'
+uselargefiles='define'
 uselongdouble='undef'
 usemallocwrap='define'
 usemorebits='undef'
index 72b7013..233eea3 100644 (file)
  *     should be used when available.
  */
 #ifndef USE_LARGE_FILES
-/*#define      USE_LARGE_FILES         / **/
+#define        USE_LARGE_FILES         /**/
 #endif
 
 /* USE_LONG_DOUBLE:
 /* Off_t_size:
  *     This symbol holds the number of bytes used by the Off_t.
  */
-#define Off_t long             /* <offset> type */
-#define LSEEKSIZE 4            /* <offset> size */
-#define Off_t_size 4   /* <offset> size */
+#define Off_t long long                /* <offset> type */
+#define LSEEKSIZE 8            /* <offset> size */
+#define Off_t_size 8   /* <offset> size */
 
 /* Mode_t:
  *     This symbol holds the type used to declare file modes
index be0d90a..62addd1 100644 (file)
  *     should be used when available.
  */
 #ifndef USE_LARGE_FILES
-/*#define      USE_LARGE_FILES         / **/
+#define        USE_LARGE_FILES         /**/
 #endif
 
 /* USE_LONG_DOUBLE:
 /* Off_t_size:
  *     This symbol holds the number of bytes used by the Off_t.
  */
-#define Off_t long             /* <offset> type */
-#define LSEEKSIZE 4            /* <offset> size */
-#define Off_t_size 4   /* <offset> size */
+#define Off_t __int64          /* <offset> type */
+#define LSEEKSIZE 8            /* <offset> size */
+#define Off_t_size 8   /* <offset> size */
 
 /* Mode_t:
  *     This symbol holds the type used to declare file modes
index bffd4ec..d154388 100644 (file)
@@ -117,16 +117,6 @@ elsif ($opt{cc} =~ /\bgcc\b/) {
     $int64  = 'long long';
 }
 
-# set large files options
-if ($opt{uselargefiles} eq 'define') {
-    $opt{lseeksize} = 8;
-    $opt{lseektype} = $int64;
-}
-else {
-    $opt{lseeksize} = 4;
-    $opt{lseektype} = 'long';
-}
-
 # set 64-bit options
 if ($opt{WIN64} eq 'define') {
     $opt{d_atoll} = 'define';
index d9d90c6..6ddc4d0 100644 (file)
@@ -88,13 +88,6 @@ USE_ITHREADS *= define
 USE_IMP_SYS    *= define
 
 #
-# Comment this out if you don't want to enable large file support for
-# some reason.  Should normally only be changed to maintain compatibility
-# with an older release of perl.
-#
-USE_LARGE_FILES        *= define
-
-#
 # Uncomment this if you're building a 32-bit perl and want 64-bit integers.
 # (If you're building a 64-bit perl then you will have 64-bit integers whether
 # or not this is uncommented.)
@@ -306,7 +299,6 @@ USE_SITECUST        *= undef
 USE_MULTI      *= undef
 USE_ITHREADS   *= undef
 USE_IMP_SYS    *= undef
-USE_LARGE_FILES        *= undef
 USE_64_BIT_INT *= undef
 USE_LONG_DOUBLE        *= undef
 DEFAULT_INC_EXCLUDES_DOT *= undef
@@ -1156,7 +1148,6 @@ CFG_VARS  =                                       \
                usemultiplicity=$(USE_MULTI)    ~       \
                use64bitint=$(USE_64_BIT_INT)   ~       \
                uselongdouble=$(USE_LONG_DOUBLE)        ~       \
-               uselargefiles=$(USE_LARGE_FILES)        ~       \
                usesitecustomize=$(USE_SITECUST)        ~       \
                default_inc_excludes_dot=$(DEFAULT_INC_EXCLUDES_DOT)    ~       \
                LINK_FLAGS=$(LINK_FLAGS)        ~       \
@@ -1279,9 +1270,6 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
        @(echo.&& \
        echo #ifndef _config_h_footer_&& \
        echo #define _config_h_footer_&& \
-       echo #undef Off_t&& \
-       echo #undef LSEEKSIZE&& \
-       echo #undef Off_t_size&& \
        echo #undef PTRSIZE&& \
        echo #undef SSize_t&& \
        echo #undef HAS_ATOLL&& \
@@ -1331,15 +1319,6 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
        echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
        echo #define I_STDBOOL)>> config.h
 .ENDIF
-.IF "$(USE_LARGE_FILES)"=="define"
-       @(echo #define Off_t $(INT64)&& \
-       echo #define LSEEKSIZE ^8&& \
-       echo #define Off_t_size ^8)>> config.h
-.ELSE
-       @(echo #define Off_t long&& \
-       echo #define LSEEKSIZE ^4&& \
-       echo #define Off_t_size ^4)>> config.h
-.ENDIF
 .IF "$(WIN64)"=="define"
 .IF "$(CCTYPE)" == "GCC"
        @(echo #define LONG_DOUBLESIZE ^16)>> config.h
index 9719f14..80b4008 100644 (file)
@@ -1526,11 +1526,7 @@ win32_stat(const char *path, Stat_t *sbuf)
     }
 
     /* path will be mapped correctly above */
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     res = _stati64(path, sbuf);
-#else
-    res = stat(path, sbuf);
-#endif
     sbuf->st_nlink = nlink;
 
     if (res < 0) {
@@ -2853,20 +2849,15 @@ win32_fflush(FILE *pf)
 DllExport Off_t
 win32_ftell(FILE *pf)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     fpos_t pos;
     if (fgetpos(pf, &pos))
        return -1;
     return (Off_t)pos;
-#else
-    return ftell(pf);
-#endif
 }
 
 DllExport int
 win32_fseek(FILE *pf, Off_t offset,int origin)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     fpos_t pos;
     switch (origin) {
     case SEEK_CUR:
@@ -2886,9 +2877,6 @@ win32_fseek(FILE *pf, Off_t offset,int origin)
        return -1;
     }
     return fsetpos(pf, &offset);
-#else
-    return fseek(pf, (long)offset, origin);
-#endif
 }
 
 DllExport int
@@ -2967,11 +2955,7 @@ win32_abort(void)
 DllExport int
 win32_fstat(int fd, Stat_t *sbufptr)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     return _fstati64(fd, sbufptr);
-#else
-    return fstat(fd, sbufptr);
-#endif
 }
 
 DllExport int
@@ -3256,7 +3240,6 @@ win32_setmode(int fd, int mode)
 DllExport int
 win32_chsize(int fd, Off_t size)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     int retval = 0;
     Off_t cur, end, extend;
 
@@ -3296,29 +3279,18 @@ win32_chsize(int fd, Off_t size)
     }
     win32_lseek(fd, cur, SEEK_SET);
     return retval;
-#else
-    return chsize(fd, (long)size);
-#endif
 }
 
 DllExport Off_t
 win32_lseek(int fd, Off_t offset, int origin)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     return _lseeki64(fd, offset, origin);
-#else
-    return lseek(fd, (long)offset, origin);
-#endif
 }
 
 DllExport Off_t
 win32_tell(int fd)
 {
-#if defined(WIN64) || defined(USE_LARGE_FILES)
     return _telli64(fd);
-#else
-    return tell(fd);
-#endif
 }
 
 DllExport int