diff options
Diffstat (limited to 'libpq/libpq/pg_config.h')
-rw-r--r-- | libpq/libpq/pg_config.h | 214 |
1 files changed, 136 insertions, 78 deletions
diff --git a/libpq/libpq/pg_config.h b/libpq/libpq/pg_config.h index fcea042..e0e61ad 100644 --- a/libpq/libpq/pg_config.h +++ b/libpq/libpq/pg_config.h @@ -3,8 +3,8 @@ */ /* - * For the semantics of the following macros refer to pg_config.h.in.orig, - * pg_config.h.win32.orig, and the upstream's configure.in. + * For the semantics of the following macros refer to pg_config.h.in.orig and + * the upstream's configure.in. * * Note that we will explicitly undefine macros that are present in the libpq * source code but should not be defined. While this is not technically @@ -15,14 +15,23 @@ #include <stddef.h> /* offsetof() */ +#if defined(__linux__) +# include <features.h> /* __GLIBC__, __GLIBC_MINOR__ */ +#endif + #include <openssl/opensslv.h> /* OPENSSL_VERSION_NUMBER */ +#define PACKAGE_NAME "PostgreSQL" +#define PACKAGE_URL "https://www.postgresql.org/" +#define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org" + /* * Version. */ #undef PG_VERSION #undef PG_VERSION_NUM #undef PG_MAJORVERSION +#undef PG_VERSION_STR #include <libpq/version.h> /* @@ -71,47 +80,71 @@ */ #ifndef _WIN32 # if __SIZEOF_LONG__ == 8 -# define HAVE_LONG_INT_64 1 +# define HAVE_LONG_INT_64 1 # endif # ifdef __SIZEOF_LONG_LONG__ -# define HAVE_LONG_LONG_INT 1 +# define HAVE_LONG_LONG_INT 1 # endif # if __SIZEOF_LONG_LONG__ == 8 -# define HAVE_LONG_LONG_INT_64 1 +# define HAVE_LONG_LONG_INT_64 1 # endif # if __SIZEOF_LONG_LONG__ > __SIZEOF_DOUBLE__ -# define MAXIMUM_ALIGNOF __SIZEOF_LONG_LONG__ +# define MAXIMUM_ALIGNOF __SIZEOF_LONG_LONG__ # else -# define MAXIMUM_ALIGNOF __SIZEOF_DOUBLE__ +# define MAXIMUM_ALIGNOF __SIZEOF_DOUBLE__ # endif # ifdef __SIZEOF_INT128__ # define PG_INT128_TYPE __int128 # define ALIGNOF_PG_INT128_TYPE 16 # endif -# define PG_INT64_TYPE __INT64_TYPE__ -# define ACCEPT_TYPE_ARG3 socklen_t -# define SIZEOF_SIZE_T __SIZEOF_SIZE_T__ +# define PG_INT64_TYPE __INT64_TYPE__ +# define ACCEPT_TYPE_ARG3 socklen_t +# define SIZEOF_SIZE_T __SIZEOF_SIZE_T__ +# define SIZEOF_VOID_P __SIZEOF_POINTER__ #else -# define HAVE_LONG_LONG_INT 1 -# define HAVE_LONG_LONG_INT_64 1 -# define MAXIMUM_ALIGNOF 8 -# define PG_INT64_TYPE long long int -# define ACCEPT_TYPE_ARG3 int +# define HAVE_LONG_LONG_INT 1 +# define HAVE_LONG_LONG_INT_64 1 +# define MAXIMUM_ALIGNOF 8 +# define PG_INT64_TYPE long long int +# define ACCEPT_TYPE_ARG3 int # ifdef _WIN64 -# define SIZEOF_SIZE_T 8 +# define SIZEOF_SIZE_T 8 +# define SIZEOF_VOID_P 8 # else -# define SIZEOF_SIZE_T 4 +# define SIZEOF_SIZE_T 4 +# define SIZEOF_VOID_P 4 # endif #endif #define INT64_MODIFIER "ll" -#define SIZEOF_BOOL 1 + +/* + * GNU libc added strlcpy() and strlcat() in version 2.38 (in anticipation + * of their addition to POSIX). + */ +#if defined(__FreeBSD__) || \ + defined(__APPLE__) || \ + (defined(__GLIBC__) && \ + defined(__GLIBC_MINOR__) && \ + (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 38)) +# define HAVE_DECL_STRLCAT 1 +# define HAVE_DECL_STRLCPY 1 +#else +# define HAVE_DECL_STRLCAT 0 +# define HAVE_DECL_STRLCPY 0 +#endif /* * Specific for FreeBSD. */ #ifdef __FreeBSD__ # define HAVE_STRUCT_CMSGCRED 1 + +/* + * Note that upstream also defines this macro for newer glibc versions (see + * buildfile for details). + */ +# define HAVE_EXPLICIT_BZERO 1 #endif /* @@ -134,8 +167,6 @@ * Specific for FreeBSD and Mac OS. */ #if defined(__FreeBSD__) || defined(__APPLE__) -# define HAVE_DECL_STRLCAT 1 -# define HAVE_DECL_STRLCPY 1 # define STRERROR_R_INT 1 # define HAVE_FLS 1 # define HAVE_GETPEEREID 1 @@ -143,51 +174,45 @@ # define HAVE_STRTOUQ 1 # define HAVE_STRUCT_SOCKADDR_SA_LEN 1 # define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 -# define HAVE_SYS_SOCKIO_H 1 # define HAVE_SYS_UCRED_H 1 # define HAVE_UNION_SEMUN 1 -#else -# define HAVE_DECL_STRLCAT 0 -# define HAVE_DECL_STRLCPY 0 +# define HAVE_MEMSET_S 1 +# define HAVE_INT_OPTRESET 1 #endif /* * Specific for POSIX. */ #ifndef _WIN32 -# define HAVE_CRYPT 1 # define HAVE_DECL_FDATASYNC 1 # define HAVE_DECL_RTLD_GLOBAL 1 # define HAVE_DECL_RTLD_NOW 1 # define HAVE_FDATASYNC 1 # define HAVE_GETADDRINFO 1 -# define HAVE_GETIFADDRS 1 -# define HAVE_IFADDRS_H 1 # define HAVE_GETPWUID_R 1 # define HAVE_INET_ATON 1 # define HAVE_LANGINFO_H 1 # define HAVE_MKDTEMP 1 # define HAVE_NETINET_TCP_H 1 -# define HAVE_NET_IF_H 1 # define HAVE_DECL_POSIX_FADVISE 1 # define HAVE_POSIX_FADVISE 1 # define HAVE_RANDOM 1 # define HAVE_SRANDOM 1 # define HAVE_STRERROR_R 1 # define HAVE_STRINGS_H 1 -# define HAVE_SYS_IOCTL_H 1 # define HAVE_POLL 1 # define HAVE_POLL_H 1 -# define HAVE_SYS_POLL_H 1 # define HAVE_SYS_SELECT_H 1 # define HAVE_SYS_UN_H 1 # define HAVE_TERMIOS_H 1 -# define HAVE_UNIX_SOCKETS 1 # define HAVE_UNSETENV 1 -# define USE_INTEGER_DATETIMES 1 # define HAVE_DLOPEN 1 # define HAVE_PREAD 1 # define HAVE_PWRITE 1 +# define HAVE_LINK 1 +# define HAVE_STRUCT_SOCKADDR_UN 1 +# define HAVE_READLINK 1 +# define HAVE_STRSIGNAL 1 /* * Specific for Windows. @@ -197,14 +222,11 @@ # define HAVE_DECL_RTLD_GLOBAL 0 # define HAVE_DECL_RTLD_NOW 0 # define HAVE_DECL_POSIX_FADVISE 0 -# define HAVE_ISINF 1 # define HAVE_FUNCNAME__FUNCTION 1 -# define USE_REPL_SNPRINTF 1 -/* - * This is not a mistake, the macro is defined opposite to the norm. - */ -# define HAVE_GETTIMEOFDAY 1 +# ifdef __MINGW32__ +# define HAVE_GETTIMEOFDAY 1 +# endif #endif /* @@ -224,52 +246,54 @@ # define HAVE__BUILTIN_BSWAP32 1 # define HAVE__BUILTIN_BSWAP64 1 # define HAVE__BUILTIN_OP_OVERFLOW 1 +# define HAVE_SETENV 1 +# define HAVE_CLOCK_GETTIME 1 +# define HAVE_GETOPT 1 +# define HAVE_GETOPT_H 1 +# define HAVE_GETOPT_LONG 1 +# define HAVE_INT_OPTERR 1 +# define HAVE_STRUCT_OPTION 1 + +/* + * _Static_assert() was introduced in C11. However, all the latest major + * compilers, except for MSVC, support it for C99 as well. + */ +# define HAVE__STATIC_ASSERT 1 #endif /* * Relates to the enabled OpenSSL. */ -#define USE_OPENSSL 1 -#define HAVE_OPENSSL_INIT_SSL 1 -#define HAVE_ASN1_STRING_GET0_DATA 1 -#define HAVE_BIO_GET_DATA 1 -#define HAVE_BIO_METH_NEW 1 -#define HAVE_SSL_CLEAR_OPTIONS 1 - -#if OPENSSL_VERSION_NUMBER < 0x10100000L -# define HAVE_CRYPTO_LOCK 1 +#define USE_OPENSSL 1 +#define HAVE_OPENSSL_INIT_SSL 1 +#define HAVE_ASN1_STRING_GET0_DATA 1 +#define HAVE_BIO_GET_DATA 1 +#define HAVE_BIO_METH_NEW 1 + +#if OPENSSL_VERSION_NUMBER >= 0x10100000L +# define HAVE_HMAC_CTX_FREE 1 +# define HAVE_HMAC_CTX_NEW 1 +#else +# define HAVE_CRYPTO_LOCK 1 #endif #if OPENSSL_VERSION_NUMBER >= 0x10002000L # define HAVE_X509_GET_SIGNATURE_NID 1 #endif -#define USE_OPENSSL_RANDOM 1 -#undef USE_DEV_URANDOM -#undef USE_WIN32_RANDOM - /* * Common for all supported OSes/compilers. */ #define ENABLE_THREAD_SAFETY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_RINT 1 -#define HAVE_DECL_SNPRINTF 1 -#define HAVE_DECL_VSNPRINTF 1 +#define PG_USE_STDBOOL 1 #define HAVE_DECL_STRNLEN 1 #define HAVE_DECL_STRTOLL 1 #define HAVE_DECL_STRTOULL 1 -#define HAVE_FSEEKO 1 #define HAVE_FUNCNAME__FUNC 1 #define HAVE_IPV6 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDBOOL_H 1 #define HAVE_STRTOLL 1 #define HAVE_STRTOULL 1 #define HAVE_STRTOF 1 -#define HAVE_TOWLOWER 1 -#define HAVE_WCSTOMBS 1 -#define HAVE_SSL_GET_CURRENT_COMPRESSION 1 #define HAVE_STRUCT_ADDRINFO 1 #define HAVE_STRUCT_SOCKADDR_STORAGE 1 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 @@ -277,18 +301,11 @@ #define XLOG_BLCKSZ 8192 #define PG_KRB_SRVNAM "postgres" #define PG_PRINTF_ATTRIBUTE printf -#define FLEXIBLE_ARRAY_MEMBER #define MEMSET_LOOP_LIMIT 1024 #define DEF_PGPORT 5432 #define DEF_PGPORT_STR "5432" /* - * _Static_assert() was introduced in C11. However, all the latest major - * compilers support it for C99 as well. - */ -#define HAVE__STATIC_ASSERT 1 - -/* * Undefined macros. */ @@ -300,11 +317,7 @@ #undef ENABLE_GSS #undef USE_LDAP -/* - * Is meaningless if NLS support is disabled (see above and libpq/buildfile for - * details). - */ -#undef LOCALEDIR +#undef HAVE_LIBREADLINE /* * Is meaningless if GSSAPI support is disabled (see above). It also seems that @@ -314,11 +327,6 @@ #undef HAVE_GSSAPI_H /* - * Integer literal LL suffix is optional for C99. - */ -#undef HAVE_LL_CONSTANTS - -/* * Windows-specific. <crtdefs.h> is included for the latest (>= 1400) VC * unconditionally. */ @@ -371,3 +379,53 @@ */ #undef HAVE___STRTOLL #undef HAVE___STRTOULL + +/* + * None of the supported platforms provides append_history(). + */ +#undef HAVE_APPEND_HISTORY + +/* + * None of the supported OSes have <editline/history.h> or + * <editline/readline.h>. + */ +#undef HAVE_EDITLINE_HISTORY_H +#undef HAVE_EDITLINE_READLINE_H + +/* + * None of the supported OSes have <history.h>. + */ +#undef HAVE_HISTORY_H +#undef HAVE_HISTORY_TRUNCATE_FILE + +/* + * None of the supported OSes have <readline.h>, <readline/history.h>, or + * <readline/readline.h>. + */ +#undef HAVE_READLINE_H +#undef HAVE_READLINE_HISTORY_H +#undef HAVE_READLINE_READLINE_H + +/* + * None of the supported platforms provides rl_completion_append_character and + * rl_completion_suppress_quote global variables and rl_completion_matches(). + */ +#undef HAVE_RL_COMPLETION_APPEND_CHARACTER +#undef HAVE_RL_COMPLETION_MATCHES +#undef HAVE_RL_COMPLETION_SUPPRESS_QUOTE + +/* + * None of the supported platforms provides rl_filename_quote_characters and + * rl_filename_quoting_function global variables and + * rl_filename_completion_function(). + */ +#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION +#undef HAVE_RL_FILENAME_QUOTE_CHARACTERS +#undef HAVE_RL_FILENAME_QUOTING_FUNCTION + +/* + * None of the supported platforms provides rl_reset_screen_size(). + */ +#undef HAVE_RL_RESET_SCREEN_SIZE + +#define pg_restrict __restrict |