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

Commita5be529

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 parentc964c21 commita5be529

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
@@ -13891,7 +13891,7 @@ $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
1389113891

1389213892
fi
1389313893

13894-
forac_funcin strtoll strtoq
13894+
forac_funcin strtoll__strtollstrtoq
1389513895
do:
1389613896
as_ac_var=`$as_echo"ac_cv_func_$ac_func"|$as_tr_sh`
1389713897
ac_fn_c_check_func"$LINENO""$ac_func""$as_ac_var"
@@ -13903,7 +13903,7 @@ _ACEOF
1390313903
fi
1390413904
done
1390513905

13906-
forac_funcin strtoull strtouq
13906+
forac_funcin strtoull__strtoullstrtouq
1390713907
do:
1390813908
as_ac_var=`$as_echo"ac_cv_func_$ac_func"|$as_tr_sh`
1390913909
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
@@ -1657,8 +1657,8 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
16571657
AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
16581658
fi
16591659

1660-
AC_CHECK_FUNCS([strtoll strtoq], [break])
1661-
AC_CHECK_FUNCS([strtoull strtouq], [break])
1660+
AC_CHECK_FUNCS([strtoll__strtollstrtoq], [break])
1661+
AC_CHECK_FUNCS([strtoull__strtoullstrtouq], [break])
16621662
# strto[u]ll may exist but not be declared
16631663
AC_CHECK_DECLS([strtoll, strtoull])
16641664

‎src/include/c.h

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

1079-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
1079+
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1080+
externintfdatasync(intfildes);
1081+
#endif
1082+
1083+
#ifdefHAVE_LONG_LONG_INT
1084+
/* Older platforms may provide strto[u]ll functionality under other names */
1085+
#if !defined(HAVE_STRTOLL)&& defined(HAVE___STRTOLL)
1086+
#definestrtoll __strtoll
1087+
#defineHAVE_STRTOLL 1
1088+
#endif
1089+
1090+
#if !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1091+
#definestrtoll strtoq
1092+
#defineHAVE_STRTOLL 1
1093+
#endif
1094+
1095+
#if !defined(HAVE_STRTOULL)&& defined(HAVE___STRTOULL)
1096+
#definestrtoull __strtoull
1097+
#defineHAVE_STRTOULL 1
1098+
#endif
1099+
1100+
#if !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1101+
#definestrtoull strtouq
1102+
#defineHAVE_STRTOULL 1
1103+
#endif
1104+
1105+
#if defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
10801106
externlong longstrtoll(constchar*str,char**endptr,intbase);
10811107
#endif
10821108

1083-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
1109+
#if defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
10841110
externunsigned long longstrtoull(constchar*str,char**endptr,intbase);
10851111
#endif
1112+
#endif/* HAVE_LONG_LONG_INT */
10861113

10871114
#if !defined(HAVE_MEMMOVE)&& !defined(memmove)
10881115
#definememmove(d,s,c)bcopy(s, d, c)
@@ -1120,22 +1147,6 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
11201147
#definesiglongjmp longjmp
11211148
#endif
11221149

1123-
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1124-
externintfdatasync(intfildes);
1125-
#endif
1126-
1127-
/* If strtoq() exists, rename it to the more standard strtoll() */
1128-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1129-
#definestrtoll strtoq
1130-
#defineHAVE_STRTOLL 1
1131-
#endif
1132-
1133-
/* If strtouq() exists, rename it to the more standard strtoull() */
1134-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1135-
#definestrtoull strtouq
1136-
#defineHAVE_STRTOULL 1
1137-
#endif
1138-
11391150
/*
11401151
* We assume if we have these two functions, we have their friends too, and
11411152
* can use the wide-character functions.

‎src/include/pg_config.h.in

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

715+
/* Define to 1 if you have the `__strtoll' function. */
716+
#undef HAVE___STRTOLL
717+
718+
/* Define to 1 if you have the `__strtoull' function. */
719+
#undef HAVE___STRTOULL
720+
715721
/* Define to the appropriate snprintf length modifier for 64-bit ints. */
716722
#undef INT64_MODIFIER
717723

‎src/include/pg_config.h.win32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,6 @@
373373
#endif
374374
#endif
375375

376-
/* Define to 1 if you have the `strtoq' function. */
377-
/* #undef HAVE_STRTOQ */
378-
379376
/* Define to 1 if you have the `strtoull' function. */
380377
#ifdef HAVE_LONG_LONG_INT_64
381378
#define HAVE_STRTOULL 1
@@ -385,9 +382,6 @@
385382
#endif
386383
#endif
387384

388-
/* Define to 1 if you have the `strtouq' function. */
389-
/* #undef HAVE_STRTOUQ */
390-
391385
/* Define to 1 if the system has the type `struct addrinfo'. */
392386
#if (_MSC_VER > 1200)
393387
#define HAVE_STRUCT_ADDRINFO 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp