Skip to content

Commit feb5935

Browse files
committed
Remove fallbacks for strtoll, strtoull.
strtoll was backfilled with either __strtoll or strtoq on systems without strtoll. The last such system on the buildfarm was an ancient HP-UX animal. We don't support HP-UX anymore, so remove. On other systems strtoll was present, but did not have a declaration. The last known instance on the buildfarm was running an ancient OSX and shut down in 2019. Author: Andres Freund <andres@anarazel.de> Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220804013546.h65najrzig764jar@awork3.anarazel.de
1 parent f68faf4 commit feb5935

File tree

7 files changed

+1
-123
lines changed

7 files changed

+1
-123
lines changed

configure

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17132,53 +17132,6 @@ $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
1713217132

1713317133
fi
1713417134

17135-
for ac_func in strtoll __strtoll strtoq
17136-
do :
17137-
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
17138-
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
17139-
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
17140-
cat >>confdefs.h <<_ACEOF
17141-
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
17142-
_ACEOF
17143-
break
17144-
fi
17145-
done
17146-
17147-
for ac_func in strtoull __strtoull strtouq
17148-
do :
17149-
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
17150-
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
17151-
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
17152-
cat >>confdefs.h <<_ACEOF
17153-
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
17154-
_ACEOF
17155-
break
17156-
fi
17157-
done
17158-
17159-
# strto[u]ll may exist but not be declared
17160-
ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
17161-
if test "x$ac_cv_have_decl_strtoll" = xyes; then :
17162-
ac_have_decl=1
17163-
else
17164-
ac_have_decl=0
17165-
fi
17166-
17167-
cat >>confdefs.h <<_ACEOF
17168-
#define HAVE_DECL_STRTOLL $ac_have_decl
17169-
_ACEOF
17170-
ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
17171-
if test "x$ac_cv_have_decl_strtoull" = xyes; then :
17172-
ac_have_decl=1
17173-
else
17174-
ac_have_decl=0
17175-
fi
17176-
17177-
cat >>confdefs.h <<_ACEOF
17178-
#define HAVE_DECL_STRTOULL $ac_have_decl
17179-
_ACEOF
17180-
17181-
1718217135
if test "$with_icu" = yes; then
1718317136
ac_save_CPPFLAGS=$CPPFLAGS
1718417137
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"

configure.ac

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,11 +1981,6 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
19811981
AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
19821982
fi
19831983

1984-
AC_CHECK_FUNCS([strtoll __strtoll strtoq], [break])
1985-
AC_CHECK_FUNCS([strtoull __strtoull strtouq], [break])
1986-
# strto[u]ll may exist but not be declared
1987-
AC_CHECK_DECLS([strtoll, strtoull])
1988-
19891984
if test "$with_icu" = yes; then
19901985
ac_save_CPPFLAGS=$CPPFLAGS
19911986
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"

src/include/c.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,35 +1294,6 @@ typedef union PGAlignedXLogBlock
12941294
extern int fdatasync(int fildes);
12951295
#endif
12961296

1297-
/* Older platforms may provide strto[u]ll functionality under other names */
1298-
#if !defined(HAVE_STRTOLL) && defined(HAVE___STRTOLL)
1299-
#define strtoll __strtoll
1300-
#define HAVE_STRTOLL 1
1301-
#endif
1302-
1303-
#if !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ)
1304-
#define strtoll strtoq
1305-
#define HAVE_STRTOLL 1
1306-
#endif
1307-
1308-
#if !defined(HAVE_STRTOULL) && defined(HAVE___STRTOULL)
1309-
#define strtoull __strtoull
1310-
#define HAVE_STRTOULL 1
1311-
#endif
1312-
1313-
#if !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ)
1314-
#define strtoull strtouq
1315-
#define HAVE_STRTOULL 1
1316-
#endif
1317-
1318-
#if defined(HAVE_STRTOLL) && !HAVE_DECL_STRTOLL
1319-
extern long long strtoll(const char *str, char **endptr, int base);
1320-
#endif
1321-
1322-
#if defined(HAVE_STRTOULL) && !HAVE_DECL_STRTOULL
1323-
extern unsigned long long strtoull(const char *str, char **endptr, int base);
1324-
#endif
1325-
13261297
/*
13271298
* Thin wrappers that convert strings to exactly 64-bit integers, matching our
13281299
* definition of int64. (For the naming, compare that POSIX has

src/include/pg_config.h.in

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,6 @@
150150
don't. */
151151
#undef HAVE_DECL_STRNLEN
152152

153-
/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
154-
don't. */
155-
#undef HAVE_DECL_STRTOLL
156-
157-
/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
158-
don't. */
159-
#undef HAVE_DECL_STRTOULL
160-
161153
/* Define to 1 if you have the <editline/history.h> header file. */
162154
#undef HAVE_EDITLINE_HISTORY_H
163155

@@ -481,18 +473,6 @@
481473
/* Define to 1 if you have the `strtof' function. */
482474
#undef HAVE_STRTOF
483475

484-
/* Define to 1 if you have the `strtoll' function. */
485-
#undef HAVE_STRTOLL
486-
487-
/* Define to 1 if you have the `strtoq' function. */
488-
#undef HAVE_STRTOQ
489-
490-
/* Define to 1 if you have the `strtoull' function. */
491-
#undef HAVE_STRTOULL
492-
493-
/* Define to 1 if you have the `strtouq' function. */
494-
#undef HAVE_STRTOUQ
495-
496476
/* Define to 1 if the system has the type `struct addrinfo'. */
497477
#undef HAVE_STRUCT_ADDRINFO
498478

@@ -688,12 +668,6 @@
688668
/* Define to 1 if your compiler understands _Static_assert. */
689669
#undef HAVE__STATIC_ASSERT
690670

691-
/* Define to 1 if you have the `__strtoll' function. */
692-
#undef HAVE___STRTOLL
693-
694-
/* Define to 1 if you have the `__strtoull' function. */
695-
#undef HAVE___STRTOULL
696-
697671
/* Define to the appropriate printf length modifier for 64-bit ints. */
698672
#undef INT64_MODIFIER
699673

src/interfaces/ecpg/ecpglib/data.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
438438
}
439439
break;
440440

441-
#ifdef HAVE_STRTOLL
442441
case ECPGt_long_long:
443442
*((long long int *) (var + offset * act_tuple)) = strtoll(pval, &scan_length, 10);
444443
if (garbage_left(isarray, &scan_length, compat))
@@ -449,8 +448,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
449448
pval = scan_length;
450449

451450
break;
452-
#endif /* HAVE_STRTOLL */
453-
#ifdef HAVE_STRTOULL
451+
454452
case ECPGt_unsigned_long_long:
455453
*((unsigned long long int *) (var + offset * act_tuple)) = strtoull(pval, &scan_length, 10);
456454
if (garbage_left(isarray, &scan_length, compat))
@@ -461,7 +459,6 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
461459
pval = scan_length;
462460

463461
break;
464-
#endif /* HAVE_STRTOULL */
465462

466463
case ECPGt_float:
467464
case ECPGt_double:

src/timezone/private.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@
4646

4747
/* PG doesn't currently rely on <inttypes.h>, so work around strtoimax() */
4848
#undef strtoimax
49-
#ifdef HAVE_STRTOLL
5049
#define strtoimax strtoll
51-
#else
52-
#define strtoimax strtol
53-
#endif
5450

5551

5652
/*

src/tools/msvc/Solution.pm

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ sub GenerateFiles
246246
HAVE_DECL_STRLCAT => 0,
247247
HAVE_DECL_STRLCPY => 0,
248248
HAVE_DECL_STRNLEN => 1,
249-
HAVE_DECL_STRTOLL => 1,
250-
HAVE_DECL_STRTOULL => 1,
251249
HAVE_EDITLINE_HISTORY_H => undef,
252250
HAVE_EDITLINE_READLINE_H => undef,
253251
HAVE_EXECINFO_H => undef,
@@ -354,10 +352,6 @@ sub GenerateFiles
354352
HAVE_STRNLEN => 1,
355353
HAVE_STRSIGNAL => undef,
356354
HAVE_STRTOF => 1,
357-
HAVE_STRTOLL => 1,
358-
HAVE_STRTOQ => undef,
359-
HAVE_STRTOULL => 1,
360-
HAVE_STRTOUQ => undef,
361355
HAVE_STRUCT_ADDRINFO => 1,
362356
HAVE_STRUCT_CMSGCRED => undef,
363357
HAVE_STRUCT_OPTION => undef,
@@ -423,8 +417,6 @@ sub GenerateFiles
423417
HAVE__CPUID => 1,
424418
HAVE__GET_CPUID => undef,
425419
HAVE__STATIC_ASSERT => undef,
426-
HAVE___STRTOLL => undef,
427-
HAVE___STRTOULL => undef,
428420
INT64_MODIFIER => qq{"ll"},
429421
LOCALE_T_IN_XLOCALE => undef,
430422
MAXIMUM_ALIGNOF => 8,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy