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

Commit06f66cf

Browse files
committed
Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.
Ancient HPUX, for one, does this. We hadn't noticed due to the lackof regression tests that required a working strtoll.(I was slightly tempted to remove the other historical spelling,strto[u]q, since it seems we have no buildfarm members testing that case.But I refrained.)Discussion:https://postgr.es/m/151935568942.1461.14623890240535309745@wrigleys.postgresql.org
1 parenta622812 commit06f66cf

File tree

5 files changed

+39
-28
lines changed

5 files changed

+39
-28
lines changed

‎configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15710,7 +15710,7 @@ $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
1571015710

1571115711
fi
1571215712

15713-
for ac_func in strtoll strtoq
15713+
for ac_func in strtoll__strtollstrtoq
1571415714
do :
1571515715
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1571615716
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -15722,7 +15722,7 @@ _ACEOF
1572215722
fi
1572315723
done
1572415724

15725-
for ac_func in strtoull strtouq
15725+
for ac_func in strtoull__strtoullstrtouq
1572615726
do :
1572715727
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1572815728
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

‎configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,8 +1749,8 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
17491749
AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
17501750
fi
17511751

1752-
AC_CHECK_FUNCS([strtoll strtoq], [break])
1753-
AC_CHECK_FUNCS([strtoull strtouq], [break])
1752+
AC_CHECK_FUNCS([strtoll__strtollstrtoq], [break])
1753+
AC_CHECK_FUNCS([strtoull__strtoullstrtouq], [break])
17541754
# strto[u]ll may exist but not be declared
17551755
AC_CHECK_DECLS([strtoll, strtoull])
17561756

‎src/include/c.h

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,13 +1096,40 @@ extern intsnprintf(char *str, size_t count, const char *fmt,...) pg_attribute_p
10961096
externintvsnprintf(char*str,size_tcount,constchar*fmt,va_listargs);
10971097
#endif
10981098

1099-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
1099+
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1100+
externintfdatasync(intfildes);
1101+
#endif
1102+
1103+
#ifdefHAVE_LONG_LONG_INT
1104+
/* Older platforms may provide strto[u]ll functionality under other names */
1105+
#if !defined(HAVE_STRTOLL)&& defined(HAVE___STRTOLL)
1106+
#definestrtoll __strtoll
1107+
#defineHAVE_STRTOLL 1
1108+
#endif
1109+
1110+
#if !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1111+
#definestrtoll strtoq
1112+
#defineHAVE_STRTOLL 1
1113+
#endif
1114+
1115+
#if !defined(HAVE_STRTOULL)&& defined(HAVE___STRTOULL)
1116+
#definestrtoull __strtoull
1117+
#defineHAVE_STRTOULL 1
1118+
#endif
1119+
1120+
#if !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1121+
#definestrtoull strtouq
1122+
#defineHAVE_STRTOULL 1
1123+
#endif
1124+
1125+
#if defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
11001126
externlong longstrtoll(constchar*str,char**endptr,intbase);
11011127
#endif
11021128

1103-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
1129+
#if defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
11041130
externunsigned long longstrtoull(constchar*str,char**endptr,intbase);
11051131
#endif
1132+
#endif/* HAVE_LONG_LONG_INT */
11061133

11071134
#if !defined(HAVE_MEMMOVE)&& !defined(memmove)
11081135
#definememmove(d,s,c)bcopy(s, d, c)
@@ -1140,22 +1167,6 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
11401167
#definesiglongjmp longjmp
11411168
#endif
11421169

1143-
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1144-
externintfdatasync(intfildes);
1145-
#endif
1146-
1147-
/* If strtoq() exists, rename it to the more standard strtoll() */
1148-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1149-
#definestrtoll strtoq
1150-
#defineHAVE_STRTOLL 1
1151-
#endif
1152-
1153-
/* If strtouq() exists, rename it to the more standard strtoull() */
1154-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1155-
#definestrtoull strtouq
1156-
#defineHAVE_STRTOULL 1
1157-
#endif
1158-
11591170
/* EXEC_BACKEND defines */
11601171
#ifdefEXEC_BACKEND
11611172
#defineNON_EXEC_STATIC

‎src/include/pg_config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,12 @@
750750
/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
751751
#undef HAVE__VA_ARGS
752752

753+
/* Define to 1 if you have the `__strtoll' function. */
754+
#undef HAVE___STRTOLL
755+
756+
/* Define to 1 if you have the `__strtoull' function. */
757+
#undef HAVE___STRTOULL
758+
753759
/* Define to the appropriate snprintf length modifier for 64-bit ints. */
754760
#undef INT64_MODIFIER
755761

‎src/include/pg_config.h.win32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@
401401
#endif
402402
#endif
403403

404-
/* Define to 1 if you have the `strtoq' function. */
405-
/* #undef HAVE_STRTOQ */
406-
407404
/* Define to 1 if you have the `strtoull' function. */
408405
#ifdef HAVE_LONG_LONG_INT_64
409406
#define HAVE_STRTOULL 1
@@ -413,9 +410,6 @@
413410
#endif
414411
#endif
415412

416-
/* Define to 1 if you have the `strtouq' function. */
417-
/* #undef HAVE_STRTOUQ */
418-
419413
/* Define to 1 if the system has the type `struct addrinfo'. */
420414
#if (_MSC_VER > 1200)
421415
#define HAVE_STRUCT_ADDRINFO 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp