mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.
Ancient HPUX, for one, does this. We hadn't noticed due to the lack of 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
This commit is contained in:
		
							
								
								
									
										6
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -23221,7 +23221,8 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for ac_func in strtoll strtoq
 | 
					
 | 
				
			||||||
 | 
					for ac_func in strtoll __strtoll strtoq
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 | 
					as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 | 
				
			||||||
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 | 
					{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 | 
				
			||||||
@@ -23323,7 +23324,8 @@ done
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for ac_func in strtoull strtouq
 | 
					
 | 
				
			||||||
 | 
					for ac_func in strtoull __strtoull strtouq
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 | 
					as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 | 
				
			||||||
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 | 
					{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1507,8 +1507,8 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
 | 
				
			|||||||
  AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
 | 
					  AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.])
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AC_CHECK_FUNCS([strtoll strtoq], [break])
 | 
					AC_CHECK_FUNCS([strtoll __strtoll strtoq], [break])
 | 
				
			||||||
AC_CHECK_FUNCS([strtoull strtouq], [break])
 | 
					AC_CHECK_FUNCS([strtoull __strtoull strtouq], [break])
 | 
				
			||||||
# strto[u]ll may exist but not be declared
 | 
					# strto[u]ll may exist but not be declared
 | 
				
			||||||
AC_CHECK_DECLS([strtoll, strtoull])
 | 
					AC_CHECK_DECLS([strtoll, strtoull])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -951,13 +951,40 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
 | 
				
			|||||||
extern int	vsnprintf(char *str, size_t count, const char *fmt, va_list args);
 | 
					extern int	vsnprintf(char *str, size_t count, const char *fmt, va_list args);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(HAVE_LONG_LONG_INT) && defined(HAVE_STRTOLL) && !HAVE_DECL_STRTOLL
 | 
					#if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC
 | 
				
			||||||
 | 
					extern int	fdatasync(int fildes);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_LONG_LONG_INT
 | 
				
			||||||
 | 
					/* Older platforms may provide strto[u]ll functionality under other names */
 | 
				
			||||||
 | 
					#if !defined(HAVE_STRTOLL) && defined(HAVE___STRTOLL)
 | 
				
			||||||
 | 
					#define strtoll __strtoll
 | 
				
			||||||
 | 
					#define HAVE_STRTOLL 1
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ)
 | 
				
			||||||
 | 
					#define strtoll strtoq
 | 
				
			||||||
 | 
					#define HAVE_STRTOLL 1
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if !defined(HAVE_STRTOULL) && defined(HAVE___STRTOULL)
 | 
				
			||||||
 | 
					#define strtoull __strtoull
 | 
				
			||||||
 | 
					#define HAVE_STRTOULL 1
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ)
 | 
				
			||||||
 | 
					#define strtoull strtouq
 | 
				
			||||||
 | 
					#define HAVE_STRTOULL 1
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(HAVE_STRTOLL) && !HAVE_DECL_STRTOLL
 | 
				
			||||||
extern long long strtoll(const char *str, char **endptr, int base);
 | 
					extern long long strtoll(const char *str, char **endptr, int base);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(HAVE_LONG_LONG_INT) && defined(HAVE_STRTOULL) && !HAVE_DECL_STRTOULL
 | 
					#if defined(HAVE_STRTOULL) && !HAVE_DECL_STRTOULL
 | 
				
			||||||
extern unsigned long long strtoull(const char *str, char **endptr, int base);
 | 
					extern unsigned long long strtoull(const char *str, char **endptr, int base);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#endif							/* HAVE_LONG_LONG_INT */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !defined(HAVE_MEMMOVE) && !defined(memmove)
 | 
					#if !defined(HAVE_MEMMOVE) && !defined(memmove)
 | 
				
			||||||
#define memmove(d, s, c)		bcopy(s, d, c)
 | 
					#define memmove(d, s, c)		bcopy(s, d, c)
 | 
				
			||||||
@@ -995,22 +1022,6 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
 | 
				
			|||||||
#define siglongjmp longjmp
 | 
					#define siglongjmp longjmp
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC
 | 
					 | 
				
			||||||
extern int	fdatasync(int fildes);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* If strtoq() exists, rename it to the more standard strtoll() */
 | 
					 | 
				
			||||||
#if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ)
 | 
					 | 
				
			||||||
#define strtoll strtoq
 | 
					 | 
				
			||||||
#define HAVE_STRTOLL 1
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* If strtouq() exists, rename it to the more standard strtoull() */
 | 
					 | 
				
			||||||
#if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ)
 | 
					 | 
				
			||||||
#define strtoull strtouq
 | 
					 | 
				
			||||||
#define HAVE_STRTOULL 1
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * We assume if we have these two functions, we have their friends too, and
 | 
					 * We assume if we have these two functions, we have their friends too, and
 | 
				
			||||||
 * can use the wide-character functions.
 | 
					 * can use the wide-character functions.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -678,6 +678,12 @@
 | 
				
			|||||||
/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
 | 
					/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
 | 
				
			||||||
#undef HAVE__VA_ARGS
 | 
					#undef HAVE__VA_ARGS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Define to 1 if you have the `__strtoll' function. */
 | 
				
			||||||
 | 
					#undef HAVE___STRTOLL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Define to 1 if you have the `__strtoull' function. */
 | 
				
			||||||
 | 
					#undef HAVE___STRTOULL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Define to the appropriate snprintf format for 64-bit ints. */
 | 
					/* Define to the appropriate snprintf format for 64-bit ints. */
 | 
				
			||||||
#undef INT64_FORMAT
 | 
					#undef INT64_FORMAT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -391,9 +391,6 @@
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Define to 1 if you have the `strtoq' function. */
 | 
					 | 
				
			||||||
/* #undef HAVE_STRTOQ */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Define to 1 if you have the `strtoull' function. */
 | 
					/* Define to 1 if you have the `strtoull' function. */
 | 
				
			||||||
#ifdef HAVE_LONG_LONG_INT_64
 | 
					#ifdef HAVE_LONG_LONG_INT_64
 | 
				
			||||||
#define HAVE_STRTOULL 1
 | 
					#define HAVE_STRTOULL 1
 | 
				
			||||||
@@ -403,9 +400,6 @@
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Define to 1 if you have the `strtouq' function. */
 | 
					 | 
				
			||||||
/* #undef HAVE_STRTOUQ */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Define to 1 if the system has the type `struct addrinfo'. */
 | 
					/* Define to 1 if the system has the type `struct addrinfo'. */
 | 
				
			||||||
#if (_MSC_VER > 1200)
 | 
					#if (_MSC_VER > 1200)
 | 
				
			||||||
#define HAVE_STRUCT_ADDRINFO 1
 | 
					#define HAVE_STRUCT_ADDRINFO 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user