Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit799d224

Browse files
committed
Assume that we have functional, 64-bit fseeko()/ftello().
Windows has this, and so do all other live platforms according to thebuildfarm, so remove the configure probe and src/port/ substitution.Keep the probe that detects whether _LARGEFILE_SOURCE has to bedefined to get that, though ... that seems to be still relevant insome places.This is part of a series of commits to get rid of no-longer-relevantconfigure checks and dead src/port/ code. I'm committing them separatelyto make it easier to back out individual changes if they prove lessportable than I expect.Discussion:https://postgr.es/m/15379.1582221614@sss.pgh.pa.us
1 parent3f9c169 commit799d224

File tree

7 files changed

+11
-141
lines changed

7 files changed

+11
-141
lines changed

‎configure

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15169,30 +15169,9 @@ _ACEOF
1516915169

1517015170
fi
1517115171

15172-
ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
15173-
if test "x$ac_cv_func_fseeko" = xyes; then :
15174-
$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
15175-
15176-
else
15177-
case " $LIBOBJS " in
15178-
*" fseeko.$ac_objext "* ) ;;
15179-
*) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
15180-
;;
15181-
esac
15182-
15183-
fi
15184-
15185-
15186-
case $host_os in
15187-
# NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
15188-
# Mingw uses macros to access Win32 API calls
15189-
netbsd*|mingw*)
15190-
15191-
$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
15192-
15193-
ac_cv_func_fseeko=yes;;
15194-
*)
15195-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
15172+
# We require 64-bit fseeko() to be available, but run this check anyway
15173+
# in case it finds that _LARGEFILE_SOURCE has to be #define'd for that.
15174+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
1519615175
$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
1519715176
if ${ac_cv_sys_largefile_source+:} false; then :
1519815177
$as_echo_n "(cached) " >&6
@@ -15259,8 +15238,7 @@ if test $ac_cv_sys_largefile_source != unknown; then
1525915238
$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
1526015239

1526115240
fi
15262-
;;
15263-
esac
15241+
1526415242

1526515243
# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
1526615244
# by calling it, 2009-04-02

‎configure.in

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,16 +1660,9 @@ PGAC_CHECK_BUILTIN_FUNC([__builtin_clz], [unsigned int x])
16601660
PGAC_CHECK_BUILTIN_FUNC([__builtin_ctz], [unsigned int x])
16611661
PGAC_CHECK_BUILTIN_FUNC([__builtin_popcount], [unsigned int x])
16621662

1663-
AC_REPLACE_FUNCS(fseeko)
1664-
case $host_os in
1665-
# NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
1666-
# Mingw uses macros to access Win32 API calls
1667-
netbsd*|mingw*)
1668-
AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.])
1669-
ac_cv_func_fseeko=yes;;
1670-
*)
1671-
AC_FUNC_FSEEKO;;
1672-
esac
1663+
# We require 64-bit fseeko() to be available, but run this check anyway
1664+
# in case it finds that _LARGEFILE_SOURCE has to be #define'd for that.
1665+
AC_FUNC_FSEEKO
16731666

16741667
# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
16751668
# by calling it, 2009-04-02

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,15 +3872,6 @@ checkSeek(FILE *fp)
38723872
{
38733873
pgoff_ttpos;
38743874

3875-
/*
3876-
* If pgoff_t is wider than long, we must have "real" fseeko and not an
3877-
* emulation using fseek. Otherwise report no seek capability.
3878-
*/
3879-
#ifndefHAVE_FSEEKO
3880-
if (sizeof(pgoff_t)>sizeof(long))
3881-
return false;
3882-
#endif
3883-
38843875
/* Check that ftello works on this file */
38853876
tpos=ftello(fp);
38863877
if (tpos<0)

‎src/include/port.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,9 @@ extern intgettimeofday(struct timeval *tp, struct timezone *tzp);
331331
* When necessary, these routines are provided by files in src/port/.
332332
*/
333333

334-
/*WIN32 handled in port/win32_port.h */
335-
#ifndefWIN32
334+
/*Type to use with fseeko/ftello */
335+
#ifndefWIN32/* WIN32 is handled in port/win32_port.h */
336336
#definepgoff_t off_t
337-
#ifdef__NetBSD__
338-
externintfseeko(FILE*stream,off_toffset,intwhence);
339-
externoff_tftello(FILE*stream);
340-
#endif
341337
#endif
342338

343339
externdoublepg_erand48(unsigned shortxseed[3]);
@@ -349,11 +345,6 @@ extern void pg_srand48(long seed);
349345
externintfls(intmask);
350346
#endif
351347

352-
#ifndefHAVE_FSEEKO
353-
#definefseeko(a,b,c) fseek(a, b, c)
354-
#defineftello(a)ftell(a)
355-
#endif
356-
357348
#ifndefHAVE_GETPEEREID
358349
/* On Windows, Perl might have incompatible definitions of uid_t and gid_t. */
359350
#ifndefPLPERL_HAVE_UID_GID

‎src/include/port/win32_port.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ intsetitimer(int which, const struct itimerval *value, struct itimerval *oval
193193
* with 64-bit offsets.
194194
*/
195195
#definepgoff_t __int64
196+
196197
#ifdef_MSC_VER
197198
#definefseeko(stream,offset,origin) _fseeki64(stream, offset, origin)
198199
#defineftello(stream) _ftelli64(stream)

‎src/port/fseeko.c

Lines changed: 0 additions & 84 deletions
This file was deleted.

‎src/tools/msvc/Mkvcbuild.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ sub mkvcbuild
9494
$solution = CreateSolution($vsVersion,$config);
9595

9696
our@pgportfiles =qw(
97-
chklocale.c explicit_bzero.c fls.cfseeko.cgetpeereid.c getrusage.c inet_aton.c random.c
97+
chklocale.c explicit_bzero.c fls.c getpeereid.c getrusage.c inet_aton.c random.c
9898
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
9999
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c
100100
dirent.c dlopen.c getopt.c getopt_long.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp