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

Commit22d22e4

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 parent4ffd790 commit22d22e4

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

1338513385
fi
1338613386

13387-
forac_funcin strtoll strtoq
13387+
forac_funcin strtoll__strtollstrtoq
1338813388
do:
1338913389
as_ac_var=`$as_echo"ac_cv_func_$ac_func"|$as_tr_sh`
1339013390
ac_fn_c_check_func"$LINENO""$ac_func""$as_ac_var"
@@ -13396,7 +13396,7 @@ _ACEOF
1339613396
fi
1339713397
done
1339813398

13399-
forac_funcin strtoull strtouq
13399+
forac_funcin strtoull__strtoullstrtouq
1340013400
do:
1340113401
as_ac_var=`$as_echo"ac_cv_func_$ac_func"|$as_tr_sh`
1340213402
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
@@ -1684,8 +1684,8 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
16841684
AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
16851685
fi
16861686

1687-
AC_CHECK_FUNCS([strtoll strtoq], [break])
1688-
AC_CHECK_FUNCS([strtoull strtouq], [break])
1687+
AC_CHECK_FUNCS([strtoll__strtollstrtoq], [break])
1688+
AC_CHECK_FUNCS([strtoull__strtoullstrtouq], [break])
16891689
# strto[u]ll may exist but not be declared
16901690
AC_CHECK_DECLS([strtoll, strtoull])
16911691

‎src/include/c.h

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

1059-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
1059+
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1060+
externintfdatasync(intfildes);
1061+
#endif
1062+
1063+
#ifdefHAVE_LONG_LONG_INT
1064+
/* Older platforms may provide strto[u]ll functionality under other names */
1065+
#if !defined(HAVE_STRTOLL)&& defined(HAVE___STRTOLL)
1066+
#definestrtoll __strtoll
1067+
#defineHAVE_STRTOLL 1
1068+
#endif
1069+
1070+
#if !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1071+
#definestrtoll strtoq
1072+
#defineHAVE_STRTOLL 1
1073+
#endif
1074+
1075+
#if !defined(HAVE_STRTOULL)&& defined(HAVE___STRTOULL)
1076+
#definestrtoull __strtoull
1077+
#defineHAVE_STRTOULL 1
1078+
#endif
1079+
1080+
#if !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1081+
#definestrtoull strtouq
1082+
#defineHAVE_STRTOULL 1
1083+
#endif
1084+
1085+
#if defined(HAVE_STRTOLL)&& !HAVE_DECL_STRTOLL
10601086
externlong longstrtoll(constchar*str,char**endptr,intbase);
10611087
#endif
10621088

1063-
#if defined(HAVE_LONG_LONG_INT)&& defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
1089+
#if defined(HAVE_STRTOULL)&& !HAVE_DECL_STRTOULL
10641090
externunsigned long longstrtoull(constchar*str,char**endptr,intbase);
10651091
#endif
1092+
#endif/* HAVE_LONG_LONG_INT */
10661093

10671094
#if !defined(HAVE_MEMMOVE)&& !defined(memmove)
10681095
#definememmove(d,s,c)bcopy(s, d, c)
@@ -1100,22 +1127,6 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
11001127
#definesiglongjmp longjmp
11011128
#endif
11021129

1103-
#if defined(HAVE_FDATASYNC)&& !HAVE_DECL_FDATASYNC
1104-
externintfdatasync(intfildes);
1105-
#endif
1106-
1107-
/* If strtoq() exists, rename it to the more standard strtoll() */
1108-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOLL)&& defined(HAVE_STRTOQ)
1109-
#definestrtoll strtoq
1110-
#defineHAVE_STRTOLL 1
1111-
#endif
1112-
1113-
/* If strtouq() exists, rename it to the more standard strtoull() */
1114-
#if defined(HAVE_LONG_LONG_INT_64)&& !defined(HAVE_STRTOULL)&& defined(HAVE_STRTOUQ)
1115-
#definestrtoull strtouq
1116-
#defineHAVE_STRTOULL 1
1117-
#endif
1118-
11191130
/*
11201131
* We assume if we have these two functions, we have their friends too, and
11211132
* 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
@@ -718,6 +718,12 @@
718718
/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
719719
#undef HAVE__VA_ARGS
720720

721+
/* Define to 1 if you have the `__strtoll' function. */
722+
#undef HAVE___STRTOLL
723+
724+
/* Define to 1 if you have the `__strtoull' function. */
725+
#undef HAVE___STRTOULL
726+
721727
/* Define to the appropriate snprintf length modifier for 64-bit ints. */
722728
#undef INT64_MODIFIER
723729

‎src/include/pg_config.h.win32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@
370370
#endif
371371
#endif
372372

373-
/* Define to 1 if you have the `strtoq' function. */
374-
/* #undef HAVE_STRTOQ */
375-
376373
/* Define to 1 if you have the `strtoull' function. */
377374
#ifdef HAVE_LONG_LONG_INT_64
378375
#define HAVE_STRTOULL 1
@@ -382,9 +379,6 @@
382379
#endif
383380
#endif
384381

385-
/* Define to 1 if you have the `strtouq' function. */
386-
/* #undef HAVE_STRTOUQ */
387-
388382
/* Define to 1 if the system has the type `struct addrinfo'. */
389383
#if (_MSC_VER > 1200)
390384
#define HAVE_STRUCT_ADDRINFO 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp