2006-06-08 00:24:46 +02:00
|
|
|
/* src/include/pg_config.h. Generated by configure. */
|
|
|
|
/* src/include/pg_config.h.in. Generated from configure.in by autoheader. */
|
2006-03-11 05:38:42 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* This file is generated from MingW ./configure, and with the following
|
|
|
|
* changes to be valid for Visual C++ (and compatible):
|
|
|
|
*
|
2011-08-08 14:52:05 +02:00
|
|
|
* HAVE_CBRT, HAVE_FUNCNAME_FUNC, HAVE_GETOPT, HAVE_GETOPT_H, HAVE_INTTYPES_H,
|
2011-04-09 23:14:20 +02:00
|
|
|
* HAVE_GETOPT_LONG, HAVE_LOCALE_T, HAVE_RINT, HAVE_STRINGS_H, HAVE_STRTOLL,
|
2015-08-05 18:19:52 +02:00
|
|
|
* HAVE_STRTOULL, HAVE_STRUCT_OPTION, ENABLE_THREAD_SAFETY,
|
Use Intel SSE 4.2 CRC instructions where available.
Modern x86 and x86-64 processors with SSE 4.2 support have special
instructions, crc32b and crc32q, for calculating CRC-32C. They greatly
speed up CRC calculation.
Whether the instructions can be used or not depends on the compiler and the
target architecture. If generation of SSE 4.2 instructions is allowed for
the target (-msse4.2 flag on gcc and clang), use them. If they are not
allowed by default, but the compiler supports the -msse4.2 flag to enable
them, compile just the CRC-32C function with -msse4.2 flag, and check at
runtime whether the processor we're running on supports it. If it doesn't,
fall back to the slicing-by-8 algorithm. (With the common defaults on
current operating systems, the runtime-check variant is what you get in
practice.)
Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
2015-04-14 16:05:03 +02:00
|
|
|
* inline, USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
|
2000-02-24 17:02:28 +01:00
|
|
|
*/
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to the type of arg 1 of 'accept' */
|
|
|
|
#define ACCEPT_TYPE_ARG1 unsigned int
|
|
|
|
|
|
|
|
/* Define to the type of arg 2 of 'accept' */
|
|
|
|
#define ACCEPT_TYPE_ARG2 struct sockaddr *
|
|
|
|
|
|
|
|
/* Define to the type of arg 3 of 'accept' */
|
|
|
|
#define ACCEPT_TYPE_ARG3 int
|
|
|
|
|
|
|
|
/* Define to the return type of 'accept' */
|
|
|
|
#define ACCEPT_TYPE_RETURN unsigned int PASCAL
|
|
|
|
|
|
|
|
/* The alignment requirement of a `double'. */
|
|
|
|
#define ALIGNOF_DOUBLE 8
|
|
|
|
|
|
|
|
/* The alignment requirement of a `int'. */
|
|
|
|
#define ALIGNOF_INT 4
|
|
|
|
|
|
|
|
/* The alignment requirement of a `long'. */
|
|
|
|
#define ALIGNOF_LONG 4
|
|
|
|
|
|
|
|
/* The alignment requirement of a `long long int'. */
|
|
|
|
#define ALIGNOF_LONG_LONG_INT 8
|
|
|
|
|
|
|
|
/* The alignment requirement of a `short'. */
|
|
|
|
#define ALIGNOF_SHORT 2
|
|
|
|
|
|
|
|
/* Define to the default TCP port number on which the server listens and to
|
|
|
|
which clients will try to connect. This can be overridden at run-time, but
|
|
|
|
it's convenient if your clients have the right default compiled in.
|
|
|
|
(--with-pgport=PORTNUM) */
|
2001-02-07 21:00:08 +01:00
|
|
|
#define DEF_PGPORT 5432
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to the default TCP port number as a string constant. */
|
Here is a patch to make the current snapshot compile on Win32 (native, libpq
and psql) again. Changes are:
1) psql requires the includes of "io.h" and "fcntl.h" in command.c in order
to make a call to open() work (io.h for _open(), fcntl.h for the O_xxx)
2) PG_VERSION is no longer defined in version.h[.in], but in configure.in.
Since we don't do configure on native win32, we need to put it in
config.h.win32 :-(
3) Added define of SYSCONFDIR to config.h.win32 - libpq won't compile
without it. This functionality is *NOT* tested - it's just defined as "" for
now. May work, may not.
4) DEF_PGPORT renamed to DEF_PGPORT_STR
I have done the "basic tests" on it - it connects to a database, and I can
run queries. Haven't tested any of the fancier functions (yet).
However, I stepped on a much bigger problem when fixing psql to work. It no
longer works when linked against the .DLL version of libpq (which the
Makefile does for it). I have left it linked against this version anyway,
pending the comments I get on this mail :-)
The problem is that there are strings being allocated from libpq.dll using
PQExpBuffers (for example, initPQExpBuffer() on line 92 of input.c). These
are being allocated using the malloc function used by libpq.dll. This
function *may* be different from the malloc function used by psql.exe - only
the resulting pointer must be valid. And with the default linking methods,
it *WILL* be different. Later, psql.exe tries to free() this string, at
which point it crashes because the free() function can't find the allocated
block (it's on the allocated blocks list used by the runtime lib of
libpq.dll).
Shouldn't the right thing to do be to have psql call termPQExpBuffer() on
the data instead? As it is now, gets_fromFile() will just return the pointer
received from the PQExpBuffer.data (this may well be present at several
places - this is the one I was bitten by so far). Isn't that kind of
"accessing the internals of the PQExpBuffer structure" wrong? Instead,
perhaps it shuold make a copy of the string, adn then termPQExpBuffer() it?
In that case, the string will have been allocated from within the same
library as the free() is called.
I can get it to work just fine by doing this - changing from (around line
100 of input.c):
and the same a bit further down in the same function.
But, as I said above, this may be at more places in the code? Perhaps
someone more familiar to it could comment on that?
What do you think shuld be done about this? Personally, I go by the "If you
allocate a piece of memory using an interface, use the same interface to
free it", but the question is how to make it work :-)
Also, AFAIK this only affects psql.exe, so the changes made to the libpq
this patch are required no matter how the other issue is handled.
Regards,
Magnus
2001-01-24 04:42:38 +01:00
|
|
|
#define DEF_PGPORT_STR "5432"
|
2001-02-07 21:00:08 +01:00
|
|
|
|
2011-06-17 04:30:24 +02:00
|
|
|
/* Define to nothing if C supports flexible array members, and to 1 if it does
|
|
|
|
not. That way, with a declaration like `struct s { int n; double
|
|
|
|
d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
|
|
|
|
compilers. When computing the size of such an object, don't use 'sizeof
|
|
|
|
(struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
|
|
|
|
instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
|
|
|
|
MSVC and with C++ compilers. */
|
2011-06-18 00:22:03 +02:00
|
|
|
#define FLEXIBLE_ARRAY_MEMBER
|
2011-06-17 04:30:24 +02:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you want National Language Support. (--enable-nls) */
|
|
|
|
/* #undef ENABLE_NLS */
|
2001-02-07 21:00:08 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 to build client libraries as thread-safe code.
|
|
|
|
(--enable-thread-safety) */
|
|
|
|
#define ENABLE_THREAD_SAFETY 1
|
2000-02-24 17:02:28 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if gettimeofday() takes only 1 argument. */
|
|
|
|
/* #undef GETTIMEOFDAY_1ARG */
|
2001-07-12 00:12:43 +02:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
#ifdef GETTIMEOFDAY_1ARG
|
|
|
|
# define gettimeofday(a,b) gettimeofday(a)
|
2003-06-12 10:15:29 +02:00
|
|
|
#endif
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `cbrt' function. */
|
|
|
|
//#define HAVE_CBRT 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `class' function. */
|
|
|
|
/* #undef HAVE_CLASS */
|
|
|
|
|
Use clock_gettime(), if available, in instr_time measurements.
The advantage of clock_gettime() is that the API allows the result to
be precise to nanoseconds, not just microseconds as in gettimeofday().
Now that it's routinely possible to do tens of plan node executions
in 1us, we really need more precision than gettimeofday() can offer
for EXPLAIN ANALYZE to accumulate statistics with.
Some research shows that clock_gettime() is available on pretty nearly
every modern Unix-ish platform, and as far as I have been able to test,
it has about the same execution time as gettimeofday(), so there's no
loss in switching over. (By the same token, this doesn't do anything
to fix the fact that we really wish clock readings were faster. But
there's enough win here to justify changing anyway.)
A small side benefit is that on most platforms, we can use CLOCK_MONOTONIC
instead of CLOCK_REALTIME and thereby render EXPLAIN impervious to
concurrent resets of the system clock. (This means that code must not
assume that the contents of struct instr_time have any well-defined
interpretation as timestamps, but really that was true before.)
Some platforms offer nonstandard clock IDs that might be of interest.
This patch knows we should use CLOCK_MONOTONIC_RAW on macOS, because it
provides more precision and is faster to read than their CLOCK_MONOTONIC.
If there turn out to be many more cases where we need special rules, it
might be appropriate to handle the selection of clock ID in configure,
but for the moment that doesn't seem worth the trouble.
Discussion: https://postgr.es/m/31856.1400021891@sss.pgh.pa.us
2017-01-02 19:41:51 +01:00
|
|
|
/* Define to 1 if you have the `clock_gettime' function. */
|
|
|
|
/* #undef HAVE_CLOCK_GETTIME */
|
|
|
|
|
2017-03-20 18:35:21 +01:00
|
|
|
/* Define to 1 if your compiler handles computed gotos. */
|
|
|
|
/* #undef HAVE_COMPUTED_GOTO */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `crypt' function. */
|
|
|
|
/* #undef HAVE_CRYPT */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <crypt.h> header file. */
|
|
|
|
/* #undef HAVE_CRYPT_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
|
|
|
|
don't. */
|
|
|
|
#define HAVE_DECL_FDATASYNC 0
|
|
|
|
|
|
|
|
/* Define to 1 if you have the declaration of `F_FULLFSYNC', and to 0 if you
|
|
|
|
don't. */
|
|
|
|
#define HAVE_DECL_F_FULLFSYNC 0
|
2006-02-12 07:11:51 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
|
|
|
|
don't. */
|
2005-12-09 05:50:40 +01:00
|
|
|
#define HAVE_DECL_SNPRINTF 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
|
|
|
|
don't. */
|
2005-12-09 05:50:40 +01:00
|
|
|
#define HAVE_DECL_VSNPRINTF 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <dld.h> header file. */
|
|
|
|
/* #undef HAVE_DLD_H */
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `dlopen' function. */
|
|
|
|
/* #undef HAVE_DLOPEN */
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <editline/history.h> header file. */
|
|
|
|
/* #undef HAVE_EDITLINE_HISTORY_H */
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <editline/readline.h> header file. */
|
|
|
|
/* #undef HAVE_EDITLINE_READLINE_H */
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `fcvt' function. */
|
|
|
|
#define HAVE_FCVT 1
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `fdatasync' function. */
|
|
|
|
/* #undef HAVE_FDATASYNC */
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have finite(). */
|
|
|
|
#define HAVE_FINITE 1
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `fpclass' function. */
|
|
|
|
/* #undef HAVE_FPCLASS */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `fp_class' function. */
|
|
|
|
/* #undef HAVE_FP_CLASS */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `fp_class_d' function. */
|
|
|
|
/* #undef HAVE_FP_CLASS_D */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <fp_class.h> header file. */
|
|
|
|
/* #undef HAVE_FP_CLASS_H */
|
|
|
|
|
|
|
|
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
2009-01-07 14:51:04 +01:00
|
|
|
#define HAVE_FSEEKO 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if your compiler understands __func__. */
|
|
|
|
//#define HAVE_FUNCNAME__FUNC 1
|
|
|
|
|
|
|
|
/* Define to 1 if your compiler understands __FUNCTION__. */
|
2007-10-01 12:54:29 +02:00
|
|
|
#define HAVE_FUNCNAME__FUNCTION 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have getaddrinfo(). */
|
|
|
|
/* #undef HAVE_GETADDRINFO */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `gethostbyname_r' function. */
|
|
|
|
/* #undef HAVE_GETHOSTBYNAME_R */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `getopt' function. */
|
|
|
|
//#define HAVE_GETOPT 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <getopt.h> header file. */
|
|
|
|
//#define HAVE_GETOPT_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `getopt_long' function. */
|
|
|
|
//#define HAVE_GETOPT_LONG 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `getpeereid' function. */
|
|
|
|
/* #undef HAVE_GETPEEREID */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `getpwuid_r' function. */
|
|
|
|
/* #undef HAVE_GETPWUID_R */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `getrusage' function. */
|
|
|
|
/* #undef HAVE_GETRUSAGE */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <history.h> header file. */
|
|
|
|
/* #undef HAVE_HISTORY_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <ieeefp.h> header file. */
|
|
|
|
/* #undef HAVE_IEEEFP_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `inet_aton' function. */
|
|
|
|
/* #undef HAVE_INET_ATON */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `int64'. */
|
|
|
|
/* #undef HAVE_INT64 */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `int8'. */
|
|
|
|
/* #undef HAVE_INT8 */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
2011-08-08 14:52:05 +02:00
|
|
|
//#define HAVE_INTTYPES_H 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the global variable 'int timezone'. */
|
2013-06-15 20:11:43 +02:00
|
|
|
#define HAVE_INT_TIMEZONE 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have support for IPv6. */
|
2007-04-16 20:39:19 +02:00
|
|
|
#define HAVE_IPV6 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have isinf(). */
|
|
|
|
#define HAVE_ISINF 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <langinfo.h> header file. */
|
|
|
|
/* #undef HAVE_LANGINFO_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <ldap.h> header file. */
|
|
|
|
/* #undef HAVE_LDAP_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
|
|
|
/* #undef HAVE_LIBCRYPTO */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `ldap' library (-lldap). */
|
|
|
|
/* #undef HAVE_LIBLDAP */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `pam' library (-lpam). */
|
|
|
|
/* #undef HAVE_LIBPAM */
|
|
|
|
|
|
|
|
/* Define if you have a function readline library */
|
|
|
|
/* #undef HAVE_LIBREADLINE */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `ssl' library (-lssl). */
|
|
|
|
/* #undef HAVE_LIBSSL */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `wldap32' library (-lwldap32). */
|
|
|
|
/* #undef HAVE_LIBWLDAP32 */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `z' library (-lz). */
|
|
|
|
/* #undef HAVE_LIBZ */
|
|
|
|
|
|
|
|
/* Define to 1 if constants of type 'long long int' should have the suffix LL.
|
|
|
|
*/
|
2006-07-06 04:12:32 +02:00
|
|
|
#if (_MSC_VER > 1200)
|
2006-06-08 00:24:46 +02:00
|
|
|
#define HAVE_LL_CONSTANTS 1
|
2006-07-06 04:12:32 +02:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
2011-04-09 23:14:20 +02:00
|
|
|
/* Define to 1 if the system has the type `locale_t'. */
|
|
|
|
#define HAVE_LOCALE_T 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if `long int' works and is 64 bits. */
|
|
|
|
/* #undef HAVE_LONG_INT_64 */
|
|
|
|
|
|
|
|
/* Define to 1 if `long long int' works and is 64 bits. */
|
2006-07-06 04:12:32 +02:00
|
|
|
#if (_MSC_VER > 1200)
|
2010-11-23 21:27:50 +01:00
|
|
|
#define HAVE_LONG_LONG_INT_64
|
2006-07-06 04:12:32 +02:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
2012-08-31 20:17:56 +02:00
|
|
|
/* Define to 1 if you have the `mbstowcs_l' function. */
|
|
|
|
#define HAVE_MBSTOWCS_L 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `memmove' function. */
|
|
|
|
#define HAVE_MEMMOVE 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <memory.h> header file. */
|
|
|
|
#define HAVE_MEMORY_H 1
|
|
|
|
|
2010-12-26 16:34:47 +01:00
|
|
|
/* Define to 1 if the system has the type `MINIDUMP_TYPE'. */
|
|
|
|
#define HAVE_MINIDUMP_TYPE 1
|
|
|
|
|
2014-06-14 15:41:13 +02:00
|
|
|
/* Define to 1 if you have the `mkdtemp' function. */
|
|
|
|
/* #undef HAVE_MKDTEMP */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
|
|
|
/* #undef HAVE_NETINET_TCP_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <pam/pam_appl.h> header file. */
|
|
|
|
/* #undef HAVE_PAM_PAM_APPL_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `poll' function. */
|
|
|
|
/* #undef HAVE_POLL */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <poll.h> header file. */
|
|
|
|
/* #undef HAVE_POLL_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `pstat' function. */
|
|
|
|
/* #undef HAVE_PSTAT */
|
|
|
|
|
|
|
|
/* Define to 1 if the PS_STRINGS thing exists. */
|
|
|
|
/* #undef HAVE_PS_STRINGS */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `random' function. */
|
|
|
|
/* #undef HAVE_RANDOM */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <readline.h> header file. */
|
|
|
|
/* #undef HAVE_READLINE_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <readline/history.h> header file. */
|
|
|
|
/* #undef HAVE_READLINE_HISTORY_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <readline/readline.h> header file. */
|
|
|
|
/* #undef HAVE_READLINE_READLINE_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `readlink' function. */
|
|
|
|
/* #undef HAVE_READLINK */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `rint' function. */
|
2014-01-26 15:49:10 +01:00
|
|
|
#if (_MSC_VER >= 1800)
|
|
|
|
#define HAVE_RINT 1
|
|
|
|
#endif
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the global variable
|
|
|
|
'rl_completion_append_character'. */
|
|
|
|
/* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `rl_completion_matches' function. */
|
|
|
|
/* #undef HAVE_RL_COMPLETION_MATCHES */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `rl_filename_completion_function' function. */
|
|
|
|
/* #undef HAVE_RL_FILENAME_COMPLETION_FUNCTION */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <security/pam_appl.h> header file. */
|
|
|
|
/* #undef HAVE_SECURITY_PAM_APPL_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `setproctitle' function. */
|
|
|
|
/* #undef HAVE_SETPROCTITLE */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `setsid' function. */
|
|
|
|
/* #undef HAVE_SETSID */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `snprintf' function. */
|
|
|
|
/* #undef HAVE_SNPRINTF */
|
|
|
|
|
|
|
|
/* Define to 1 if you have spinlocks. */
|
|
|
|
#define HAVE_SPINLOCKS 1
|
|
|
|
|
Add a basic atomic ops API abstracting away platform/architecture details.
Several upcoming performance/scalability improvements require atomic
operations. This new API avoids the need to splatter compiler and
architecture dependent code over all the locations employing atomic
ops.
For several of the potential usages it'd be problematic to maintain
both, a atomics using implementation and one using spinlocks or
similar. In all likelihood one of the implementations would not get
tested regularly under concurrency. To avoid that scenario the new API
provides a automatic fallback of atomic operations to spinlocks. All
properties of atomic operations are maintained. This fallback -
obviously - isn't as fast as just using atomic ops, but it's not bad
either. For one of the future users the atomics ontop spinlocks
implementation was actually slightly faster than the old purely
spinlock using implementation. That's important because it reduces the
fear of regressing older platforms when improving the scalability for
new ones.
The API, loosely modeled after the C11 atomics support, currently
provides 'atomic flags' and 32 bit unsigned integers. If the platform
efficiently supports atomic 64 bit unsigned integers those are also
provided.
To implement atomics support for a platform/architecture/compiler for
a type of atomics 32bit compare and exchange needs to be
implemented. If available and more efficient native support for flags,
32 bit atomic addition, and corresponding 64 bit operations may also
be provided. Additional useful atomic operations are implemented
generically ontop of these.
The implementation for various versions of gcc, msvc and sun studio have
been tested. Additional existing stub implementations for
* Intel icc
* HUPX acc
* IBM xlc
are included but have never been tested. These will likely require
fixes based on buildfarm and user feedback.
As atomic operations also require barriers for some operations the
existing barrier support has been moved into the atomics code.
Author: Andres Freund with contributions from Oskari Saarenmaa
Reviewed-By: Amit Kapila, Robert Haas, Heikki Linnakangas and Álvaro Herrera
Discussion: CA+TgmoYBW+ux5-8Ja=Mcyuy8=VXAnVRHp3Kess6Pn3DMXAPAEA@mail.gmail.com,
20131015123303.GH5300@awork2.anarazel.de,
20131028205522.GI20248@awork2.anarazel.de
2014-09-25 23:49:05 +02:00
|
|
|
/* Define to 1 if you have atomics. */
|
|
|
|
#define HAVE_ATOMICS 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `srandom' function. */
|
|
|
|
/* #undef HAVE_SRANDOM */
|
|
|
|
|
2014-07-15 18:04:43 +02:00
|
|
|
/* Define to 1 if you have the `SSL_get_current_compression' function. */
|
|
|
|
#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <stdint.h> header file. */
|
2009-12-31 20:41:37 +01:00
|
|
|
/* #undef HAVE_STDINT_H */
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
|
|
#define HAVE_STDLIB_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `strerror' function. */
|
2007-01-26 18:45:42 +01:00
|
|
|
#ifndef HAVE_STRERROR
|
2006-06-08 00:24:46 +02:00
|
|
|
#define HAVE_STRERROR 1
|
2007-01-26 18:45:42 +01:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the `strerror_r' function. */
|
|
|
|
/* #undef HAVE_STRERROR_R */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <strings.h> header file. */
|
|
|
|
/*#define HAVE_STRINGS_H 1 */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <string.h> header file. */
|
|
|
|
#define HAVE_STRING_H 1
|
|
|
|
|
Replace PostmasterRandom() with a stronger source, second attempt.
This adds a new routine, pg_strong_random() for generating random bytes,
for use in both frontend and backend. At the moment, it's only used in
the backend, but the upcoming SCRAM authentication patches need strong
random numbers in libpq as well.
pg_strong_random() is based on, and replaces, the existing implementation
in pgcrypto. It can acquire strong random numbers from a number of sources,
depending on what's available:
- OpenSSL RAND_bytes(), if built with OpenSSL
- On Windows, the native cryptographic functions are used
- /dev/urandom
Unlike the current pgcrypto function, the source is chosen by configure.
That makes it easier to test different implementations, and ensures that
we don't accidentally fall back to a less secure implementation, if the
primary source fails. All of those methods are quite reliable, it would be
pretty surprising for them to fail, so we'd rather find out by failing
hard.
If no strong random source is available, we fall back to using erand48(),
seeded from current timestamp, like PostmasterRandom() was. That isn't
cryptographically secure, but allows us to still work on platforms that
don't have any of the above stronger sources. Because it's not very secure,
the built-in implementation is only used if explicitly requested with
--disable-strong-random.
This replaces the more complicated Fortuna algorithm we used to have in
pgcrypto, which is unfortunate, but all modern platforms have /dev/urandom,
so it doesn't seem worth the maintenance effort to keep that. pgcrypto
functions that require strong random numbers will be disabled with
--disable-strong-random.
Original patch by Magnus Hagander, tons of further work by Michael Paquier
and me.
Discussion: https://www.postgresql.org/message-id/CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAB7nPqRWkNYRRPJA7-cF+LfroYV10pvjdz6GNvxk-Eee9FypKA@mail.gmail.com
2016-12-05 12:42:59 +01:00
|
|
|
/* Define to use have a strong random number source */
|
|
|
|
#define HAVE_STRONG_RANDOM 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `strtoll' function. */
|
|
|
|
//#define HAVE_STRTOLL 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `strtoq' function. */
|
|
|
|
/* #undef HAVE_STRTOQ */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `strtoull' function. */
|
|
|
|
//#define HAVE_STRTOULL 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `strtouq' function. */
|
|
|
|
/* #undef HAVE_STRTOUQ */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `struct addrinfo'. */
|
2006-07-06 04:12:32 +02:00
|
|
|
#if (_MSC_VER > 1200)
|
2006-06-08 00:24:46 +02:00
|
|
|
#define HAVE_STRUCT_ADDRINFO 1
|
2006-07-06 04:12:32 +02:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `struct cmsgcred'. */
|
|
|
|
/* #undef HAVE_STRUCT_CMSGCRED */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `struct option'. */
|
|
|
|
//#define HAVE_STRUCT_OPTION 1
|
|
|
|
|
|
|
|
/* Define to 1 if `sa_len' is member of `struct sockaddr'. */
|
|
|
|
/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
|
2006-07-06 04:12:32 +02:00
|
|
|
#if (_MSC_VER > 1200)
|
2006-06-08 00:24:46 +02:00
|
|
|
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
2006-07-06 04:12:32 +02:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */
|
2006-07-06 04:12:32 +02:00
|
|
|
#if (_MSC_VER > 1200)
|
2006-06-08 00:24:46 +02:00
|
|
|
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
|
2006-07-06 04:12:32 +02:00
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if `ss_len' is member of `struct sockaddr_storage'. */
|
|
|
|
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN */
|
|
|
|
|
|
|
|
/* Define to 1 if `__ss_family' is member of `struct sockaddr_storage'. */
|
|
|
|
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
|
|
|
|
|
|
|
|
/* Define to 1 if `__ss_len' is member of `struct sockaddr_storage'. */
|
|
|
|
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `struct sockaddr_un'. */
|
|
|
|
/* #undef HAVE_STRUCT_SOCKADDR_UN */
|
|
|
|
|
|
|
|
/* Define to 1 if `tm_zone' is member of `struct tm'. */
|
|
|
|
/* #undef HAVE_STRUCT_TM_TM_ZONE */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `symlink' function. */
|
|
|
|
#define HAVE_SYMLINK 1
|
|
|
|
|
2012-07-13 23:16:58 +02:00
|
|
|
/* Define to 1 if you have the `sync_file_range' function. */
|
|
|
|
/* #undef HAVE_SYNC_FILE_RANGE */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the `sysconf' function. */
|
|
|
|
/* #undef HAVE_SYSCONF */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the syslog interface. */
|
|
|
|
/* #undef HAVE_SYSLOG */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_IPC_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/poll.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_POLL_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/pstat.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_PSTAT_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/select.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_SELECT_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/sem.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_SEM_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/shm.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_SHM_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
|
|
#define HAVE_SYS_STAT_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
|
|
#define HAVE_SYS_TYPES_H 1
|
|
|
|
|
Replace use of credential control messages with getsockopt(LOCAL_PEERCRED).
It turns out the reason we hadn't found out about the portability issues
with our credential-control-message code is that almost no modern platforms
use that code at all; the ones that used to need it now offer getpeereid(),
which we choose first. The last holdout was NetBSD, and they added
getpeereid() as of 5.0. So far as I can tell, the only live platform on
which that code was being exercised was Debian/kFreeBSD, ie, FreeBSD kernel
with Linux userland --- since glibc doesn't provide getpeereid(), we fell
back to the control message code. However, the FreeBSD kernel provides a
LOCAL_PEERCRED socket parameter that's functionally equivalent to Linux's
SO_PEERCRED. That is both much simpler to use than control messages, and
superior because it doesn't require receiving a message from the other end
at just the right time.
Therefore, add code to use LOCAL_PEERCRED when necessary, and rip out all
the credential-control-message code in the backend. (libpq still has such
code so that it can still talk to pre-9.1 servers ... but eventually we can
get rid of it there too.) Clean up related autoconf probes, too.
This means that libpq's requirepeer parameter now works on exactly the same
platforms where the backend supports peer authentication, so adjust the
documentation accordingly.
2011-05-31 22:10:46 +02:00
|
|
|
/* Define to 1 if you have the <sys/ucred.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_UCRED_H */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <sys/un.h> header file. */
|
|
|
|
/* #undef HAVE_SYS_UN_H */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <termios.h> header file. */
|
|
|
|
/* #undef HAVE_TERMIOS_H */
|
|
|
|
|
|
|
|
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
|
|
|
|
`HAVE_STRUCT_TM_TM_ZONE' instead. */
|
|
|
|
/* #undef HAVE_TM_ZONE */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `towlower' function. */
|
|
|
|
#define HAVE_TOWLOWER 1
|
|
|
|
|
2017-03-09 21:18:59 +01:00
|
|
|
/* Define to 1 if your compiler understands `typeof' or something similar. */
|
|
|
|
#define HAVE_TYPEOF 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the external array `tzname'. */
|
|
|
|
/* #undef HAVE_TZNAME */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `uint64'. */
|
|
|
|
/* #undef HAVE_UINT64 */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `uint8'. */
|
|
|
|
/* #undef HAVE_UINT8 */
|
|
|
|
|
|
|
|
/* Define to 1 if the system has the type `union semun'. */
|
|
|
|
/* #undef HAVE_UNION_SEMUN */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <unistd.h> header file. */
|
|
|
|
#define HAVE_UNISTD_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have unix sockets. */
|
|
|
|
/* #undef HAVE_UNIX_SOCKETS */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `unsetenv' function. */
|
|
|
|
/* #undef HAVE_UNSETENV */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `utime' function. */
|
|
|
|
#define HAVE_UTIME 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `utimes' function. */
|
|
|
|
/* #undef HAVE_UTIMES */
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <utime.h> header file. */
|
|
|
|
#define HAVE_UTIME_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `vsnprintf' function. */
|
2006-11-22 00:26:47 +01:00
|
|
|
#define HAVE_VSNPRINTF 1
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the <wchar.h> header file. */
|
|
|
|
#define HAVE_WCHAR_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `wcstombs' function. */
|
|
|
|
#define HAVE_WCSTOMBS 1
|
|
|
|
|
2011-04-23 18:35:41 +02:00
|
|
|
/* Define to 1 if you have the `wcstombs_l' function. */
|
|
|
|
#define HAVE_WCSTOMBS_L 1
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 if you have the <wctype.h> header file. */
|
|
|
|
#define HAVE_WCTYPE_H 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <winldap.h> header file. */
|
|
|
|
/* #undef HAVE_WINLDAP_H */
|
|
|
|
|
2015-02-10 09:54:40 +01:00
|
|
|
/* Define to 1 if your compiler understands __builtin_bswap32. */
|
|
|
|
/* #undef HAVE__BUILTIN_BSWAP32 */
|
|
|
|
|
2015-10-08 19:01:36 +02:00
|
|
|
/* Define to 1 if your compiler understands __builtin_bswap64. */
|
|
|
|
/* #undef HAVE__BUILTIN_BSWAP64 */
|
|
|
|
|
Improve handling of ereport(ERROR) and elog(ERROR).
In commit 71450d7fd6c7cf7b3e38ac56e363bff6a681973c, we added code to inform
suitably-intelligent compilers that ereport() doesn't return if the elevel
is ERROR or higher. This patch extends that to elog(), and also fixes a
double-evaluation hazard that the previous commit created in ereport(),
as well as reducing the emitted code size.
The elog() improvement requires the compiler to support __VA_ARGS__, which
should be available in just about anything nowadays since it's required by
C99. But our minimum language baseline is still C89, so add a configure
test for that.
The previous commit assumed that ereport's elevel could be evaluated twice,
which isn't terribly safe --- there are already counterexamples in xlog.c.
On compilers that have __builtin_constant_p, we can use that to protect the
second test, since there's no possible optimization gain if the compiler
doesn't know the value of elevel. Otherwise, use a local variable inside
the macros to prevent double evaluation. The local-variable solution is
inferior because (a) it leads to useless code being emitted when elevel
isn't constant, and (b) it increases the optimization level needed for the
compiler to recognize that subsequent code is unreachable. But it seems
better than not teaching non-gcc compilers about unreachability at all.
Lastly, if the compiler has __builtin_unreachable(), we can use that
instead of abort(), resulting in a noticeable code savings since no
function call is actually emitted. However, it seems wise to do this only
in non-assert builds. In an assert build, continue to use abort(), so that
the behavior will be predictable and debuggable if the "impossible"
happens.
These changes involve making the ereport and elog macros emit do-while
statement blocks not just expressions, which forces small changes in
a few call sites.
Andres Freund, Tom Lane, Heikki Linnakangas
2013-01-14 00:39:20 +01:00
|
|
|
/* Define to 1 if your compiler understands __builtin_constant_p. */
|
|
|
|
/* #undef HAVE__BUILTIN_CONSTANT_P */
|
|
|
|
|
2012-09-30 20:38:31 +02:00
|
|
|
/* Define to 1 if your compiler understands __builtin_types_compatible_p. */
|
|
|
|
/* #undef HAVE__BUILTIN_TYPES_COMPATIBLE_P */
|
|
|
|
|
Improve handling of ereport(ERROR) and elog(ERROR).
In commit 71450d7fd6c7cf7b3e38ac56e363bff6a681973c, we added code to inform
suitably-intelligent compilers that ereport() doesn't return if the elevel
is ERROR or higher. This patch extends that to elog(), and also fixes a
double-evaluation hazard that the previous commit created in ereport(),
as well as reducing the emitted code size.
The elog() improvement requires the compiler to support __VA_ARGS__, which
should be available in just about anything nowadays since it's required by
C99. But our minimum language baseline is still C89, so add a configure
test for that.
The previous commit assumed that ereport's elevel could be evaluated twice,
which isn't terribly safe --- there are already counterexamples in xlog.c.
On compilers that have __builtin_constant_p, we can use that to protect the
second test, since there's no possible optimization gain if the compiler
doesn't know the value of elevel. Otherwise, use a local variable inside
the macros to prevent double evaluation. The local-variable solution is
inferior because (a) it leads to useless code being emitted when elevel
isn't constant, and (b) it increases the optimization level needed for the
compiler to recognize that subsequent code is unreachable. But it seems
better than not teaching non-gcc compilers about unreachability at all.
Lastly, if the compiler has __builtin_unreachable(), we can use that
instead of abort(), resulting in a noticeable code savings since no
function call is actually emitted. However, it seems wise to do this only
in non-assert builds. In an assert build, continue to use abort(), so that
the behavior will be predictable and debuggable if the "impossible"
happens.
These changes involve making the ereport and elog macros emit do-while
statement blocks not just expressions, which forces small changes in
a few call sites.
Andres Freund, Tom Lane, Heikki Linnakangas
2013-01-14 00:39:20 +01:00
|
|
|
/* Define to 1 if your compiler understands __builtin_unreachable. */
|
|
|
|
/* #undef HAVE__BUILTIN_UNREACHABLE */
|
|
|
|
|
Use Intel SSE 4.2 CRC instructions where available.
Modern x86 and x86-64 processors with SSE 4.2 support have special
instructions, crc32b and crc32q, for calculating CRC-32C. They greatly
speed up CRC calculation.
Whether the instructions can be used or not depends on the compiler and the
target architecture. If generation of SSE 4.2 instructions is allowed for
the target (-msse4.2 flag on gcc and clang), use them. If they are not
allowed by default, but the compiler supports the -msse4.2 flag to enable
them, compile just the CRC-32C function with -msse4.2 flag, and check at
runtime whether the processor we're running on supports it. If it doesn't,
fall back to the slicing-by-8 algorithm. (With the common defaults on
current operating systems, the runtime-check variant is what you get in
practice.)
Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
2015-04-14 16:05:03 +02:00
|
|
|
/* Define to 1 if you have __cpuid. */
|
|
|
|
#define HAVE__CPUID 1
|
|
|
|
|
|
|
|
/* Define to 1 if you have __get_cpuid. */
|
|
|
|
#undef HAVE__GET_CPUID
|
|
|
|
|
2012-09-30 20:38:31 +02:00
|
|
|
/* Define to 1 if your compiler understands _Static_assert. */
|
|
|
|
/* #undef HAVE__STATIC_ASSERT */
|
|
|
|
|
Improve handling of ereport(ERROR) and elog(ERROR).
In commit 71450d7fd6c7cf7b3e38ac56e363bff6a681973c, we added code to inform
suitably-intelligent compilers that ereport() doesn't return if the elevel
is ERROR or higher. This patch extends that to elog(), and also fixes a
double-evaluation hazard that the previous commit created in ereport(),
as well as reducing the emitted code size.
The elog() improvement requires the compiler to support __VA_ARGS__, which
should be available in just about anything nowadays since it's required by
C99. But our minimum language baseline is still C89, so add a configure
test for that.
The previous commit assumed that ereport's elevel could be evaluated twice,
which isn't terribly safe --- there are already counterexamples in xlog.c.
On compilers that have __builtin_constant_p, we can use that to protect the
second test, since there's no possible optimization gain if the compiler
doesn't know the value of elevel. Otherwise, use a local variable inside
the macros to prevent double evaluation. The local-variable solution is
inferior because (a) it leads to useless code being emitted when elevel
isn't constant, and (b) it increases the optimization level needed for the
compiler to recognize that subsequent code is unreachable. But it seems
better than not teaching non-gcc compilers about unreachability at all.
Lastly, if the compiler has __builtin_unreachable(), we can use that
instead of abort(), resulting in a noticeable code savings since no
function call is actually emitted. However, it seems wise to do this only
in non-assert builds. In an assert build, continue to use abort(), so that
the behavior will be predictable and debuggable if the "impossible"
happens.
These changes involve making the ereport and elog macros emit do-while
statement blocks not just expressions, which forces small changes in
a few call sites.
Andres Freund, Tom Lane, Heikki Linnakangas
2013-01-14 00:39:20 +01:00
|
|
|
/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
|
|
|
|
#define HAVE__VA_ARGS 1
|
|
|
|
|
2014-08-21 08:56:44 +02:00
|
|
|
/* Define to the appropriate snprintf length modifier for 64-bit ints. */
|
|
|
|
#define INT64_MODIFIER "ll"
|
2006-06-08 00:24:46 +02:00
|
|
|
|
2011-04-09 23:14:20 +02:00
|
|
|
/* Define to 1 if `locale_t' requires <xlocale.h>. */
|
|
|
|
/* #undef LOCALE_T_IN_XLOCALE */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to the location of locale files. */
|
|
|
|
/* #undef LOCALEDIR */
|
|
|
|
|
|
|
|
/* Define as the maximum alignment requirement of any C data type. */
|
|
|
|
#define MAXIMUM_ALIGNOF 8
|
|
|
|
|
|
|
|
/* Define bytes to use libc memset(). */
|
|
|
|
#define MEMSET_LOOP_LIMIT 1024
|
|
|
|
|
|
|
|
/* Define to the address where bug reports for this package should be sent. */
|
|
|
|
#define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org"
|
|
|
|
|
|
|
|
/* Define to the full name of this package. */
|
|
|
|
#define PACKAGE_NAME "PostgreSQL"
|
|
|
|
|
|
|
|
/* Define to the full name and version of this package. */
|
2016-08-15 19:49:49 +02:00
|
|
|
#define PACKAGE_STRING "PostgreSQL 10devel"
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to the version of this package. */
|
2016-08-15 19:49:49 +02:00
|
|
|
#define PACKAGE_VERSION "10devel"
|
2006-06-08 00:24:46 +02:00
|
|
|
|
Add, optional, support for 128bit integers.
We will, for the foreseeable future, not expose 128 bit datatypes to
SQL. But being able to use 128bit math will allow us, in a later patch,
to use 128bit accumulators for some aggregates; leading to noticeable
speedups over using numeric.
So far we only detect a gcc/clang extension that supports 128bit math,
but no 128bit literals, and no *printf support. We might want to expand
this in the future to further compilers; if there are any that that
provide similar support.
Discussion: 544BB5F1.50709@proxel.se
Author: Andreas Karlsson, with significant editorializing by me
Reviewed-By: Peter Geoghegan, Oskari Saarenmaa
2015-03-20 10:26:17 +01:00
|
|
|
/* Define to the name of a signed 128-bit integer type. */
|
|
|
|
#undef PG_INT128_TYPE
|
|
|
|
|
2012-10-08 03:52:07 +02:00
|
|
|
/* Define to the name of a signed 64-bit integer type. */
|
|
|
|
#define PG_INT64_TYPE long long int
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* PostgreSQL version as a string */
|
2016-08-15 19:49:49 +02:00
|
|
|
#define PG_VERSION "10devel"
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* PostgreSQL version as a number */
|
2016-08-15 19:49:49 +02:00
|
|
|
#define PG_VERSION_NUM 100000
|
2006-06-08 00:24:46 +02:00
|
|
|
|
2006-10-24 00:50:20 +02:00
|
|
|
/* Define to the one symbol short name of this package. */
|
|
|
|
#define PACKAGE_TARNAME "postgresql"
|
|
|
|
|
|
|
|
/* Define to the name of the default PostgreSQL service principal in Kerberos.
|
|
|
|
(--with-krb-srvnam=NAME) */
|
|
|
|
#define PG_KRB_SRVNAM "postgres"
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* A string containing the version number, platform, and C compiler */
|
|
|
|
#define PG_VERSION_STR "Uninitialized version string (win32)"
|
|
|
|
|
2009-12-31 20:41:37 +01:00
|
|
|
/* The size of `long', as computed by sizeof. */
|
|
|
|
#define SIZEOF_LONG 4
|
|
|
|
|
|
|
|
/* The size of `size_t', as computed by sizeof. */
|
2010-01-02 14:56:37 +01:00
|
|
|
#ifndef _WIN64
|
2006-06-08 00:24:46 +02:00
|
|
|
#define SIZEOF_SIZE_T 4
|
2010-01-02 14:56:37 +01:00
|
|
|
#else
|
|
|
|
#define SIZEOF_SIZE_T 8
|
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
2009-12-31 20:41:37 +01:00
|
|
|
/* The size of `void *', as computed by sizeof. */
|
2010-01-02 14:56:37 +01:00
|
|
|
#ifndef _WIN64
|
2009-12-31 20:41:37 +01:00
|
|
|
#define SIZEOF_VOID_P 4
|
2010-01-02 14:56:37 +01:00
|
|
|
#else
|
|
|
|
#define SIZEOF_VOID_P 8
|
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to 1 if you have the ANSI C header files. */
|
|
|
|
#define STDC_HEADERS 1
|
|
|
|
|
|
|
|
/* Define to 1 if strerror_r() returns a int. */
|
|
|
|
/* #undef STRERROR_R_INT */
|
|
|
|
|
|
|
|
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
|
|
|
/* #undef TM_IN_SYS_TIME */
|
|
|
|
|
|
|
|
/* Define to 1 to build with assertion checks. (--enable-cassert) */
|
|
|
|
/* #undef USE_ASSERT_CHECKING */
|
|
|
|
|
|
|
|
/* Define to 1 to build with Bonjour support. (--with-bonjour) */
|
|
|
|
/* #undef USE_BONJOUR */
|
|
|
|
|
2016-04-08 19:51:54 +02:00
|
|
|
/* Define to 1 to build with BSD Authentication support. (--with-bsd-auth) */
|
|
|
|
/* #undef USE_BSD_AUTH */
|
|
|
|
|
Replace PostmasterRandom() with a stronger source, second attempt.
This adds a new routine, pg_strong_random() for generating random bytes,
for use in both frontend and backend. At the moment, it's only used in
the backend, but the upcoming SCRAM authentication patches need strong
random numbers in libpq as well.
pg_strong_random() is based on, and replaces, the existing implementation
in pgcrypto. It can acquire strong random numbers from a number of sources,
depending on what's available:
- OpenSSL RAND_bytes(), if built with OpenSSL
- On Windows, the native cryptographic functions are used
- /dev/urandom
Unlike the current pgcrypto function, the source is chosen by configure.
That makes it easier to test different implementations, and ensures that
we don't accidentally fall back to a less secure implementation, if the
primary source fails. All of those methods are quite reliable, it would be
pretty surprising for them to fail, so we'd rather find out by failing
hard.
If no strong random source is available, we fall back to using erand48(),
seeded from current timestamp, like PostmasterRandom() was. That isn't
cryptographically secure, but allows us to still work on platforms that
don't have any of the above stronger sources. Because it's not very secure,
the built-in implementation is only used if explicitly requested with
--disable-strong-random.
This replaces the more complicated Fortuna algorithm we used to have in
pgcrypto, which is unfortunate, but all modern platforms have /dev/urandom,
so it doesn't seem worth the maintenance effort to keep that. pgcrypto
functions that require strong random numbers will be disabled with
--disable-strong-random.
Original patch by Magnus Hagander, tons of further work by Michael Paquier
and me.
Discussion: https://www.postgresql.org/message-id/CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAB7nPqRWkNYRRPJA7-cF+LfroYV10pvjdz6GNvxk-Eee9FypKA@mail.gmail.com
2016-12-05 12:42:59 +01:00
|
|
|
/* Define to use /dev/urandom for random number generation */
|
|
|
|
/* #undef USE_DEV_URANDOM */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 to build with LDAP support. (--with-ldap) */
|
|
|
|
/* #undef USE_LDAP */
|
|
|
|
|
|
|
|
/* Define to select named POSIX semaphores. */
|
|
|
|
/* #undef USE_NAMED_POSIX_SEMAPHORES */
|
|
|
|
|
Break out OpenSSL-specific code to separate files.
This refactoring is in preparation for adding support for other SSL
implementations, with no user-visible effects. There are now two #defines,
USE_OPENSSL which is defined when building with OpenSSL, and USE_SSL which
is defined when building with any SSL implementation. Currently, OpenSSL is
the only implementation so the two #defines go together, but USE_SSL is
supposed to be used for implementation-independent code.
The libpq SSL code is changed to use a custom BIO, which does all the raw
I/O, like we've been doing in the backend for a long time. That makes it
possible to use MSG_NOSIGNAL to block SIGPIPE when using SSL, which avoids
a couple of syscall for each send(). Probably doesn't make much performance
difference in practice - the SSL encryption is expensive enough to mask the
effect - but it was a natural result of this refactoring.
Based on a patch by Martijn van Oosterhout from 2006. Briefly reviewed by
Alvaro Herrera, Andreas Karlsson, Jeff Janes.
2014-08-11 10:54:19 +02:00
|
|
|
/* Define to build with OpenSSL support. (--with-openssl) */
|
|
|
|
/* #undef USE_OPENSSL */
|
|
|
|
|
Replace PostmasterRandom() with a stronger source, second attempt.
This adds a new routine, pg_strong_random() for generating random bytes,
for use in both frontend and backend. At the moment, it's only used in
the backend, but the upcoming SCRAM authentication patches need strong
random numbers in libpq as well.
pg_strong_random() is based on, and replaces, the existing implementation
in pgcrypto. It can acquire strong random numbers from a number of sources,
depending on what's available:
- OpenSSL RAND_bytes(), if built with OpenSSL
- On Windows, the native cryptographic functions are used
- /dev/urandom
Unlike the current pgcrypto function, the source is chosen by configure.
That makes it easier to test different implementations, and ensures that
we don't accidentally fall back to a less secure implementation, if the
primary source fails. All of those methods are quite reliable, it would be
pretty surprising for them to fail, so we'd rather find out by failing
hard.
If no strong random source is available, we fall back to using erand48(),
seeded from current timestamp, like PostmasterRandom() was. That isn't
cryptographically secure, but allows us to still work on platforms that
don't have any of the above stronger sources. Because it's not very secure,
the built-in implementation is only used if explicitly requested with
--disable-strong-random.
This replaces the more complicated Fortuna algorithm we used to have in
pgcrypto, which is unfortunate, but all modern platforms have /dev/urandom,
so it doesn't seem worth the maintenance effort to keep that. pgcrypto
functions that require strong random numbers will be disabled with
--disable-strong-random.
Original patch by Magnus Hagander, tons of further work by Michael Paquier
and me.
Discussion: https://www.postgresql.org/message-id/CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAB7nPqRWkNYRRPJA7-cF+LfroYV10pvjdz6GNvxk-Eee9FypKA@mail.gmail.com
2016-12-05 12:42:59 +01:00
|
|
|
/* Define to use OpenSSL for random number generation */
|
|
|
|
/* #undef USE_OPENSSL_RANDOM */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to 1 to build with PAM support. (--with-pam) */
|
|
|
|
/* #undef USE_PAM */
|
|
|
|
|
|
|
|
/* Use replacement snprintf() functions. */
|
|
|
|
#define USE_REPL_SNPRINTF 1
|
|
|
|
|
Use Intel SSE 4.2 CRC instructions where available.
Modern x86 and x86-64 processors with SSE 4.2 support have special
instructions, crc32b and crc32q, for calculating CRC-32C. They greatly
speed up CRC calculation.
Whether the instructions can be used or not depends on the compiler and the
target architecture. If generation of SSE 4.2 instructions is allowed for
the target (-msse4.2 flag on gcc and clang), use them. If they are not
allowed by default, but the compiler supports the -msse4.2 flag to enable
them, compile just the CRC-32C function with -msse4.2 flag, and check at
runtime whether the processor we're running on supports it. If it doesn't,
fall back to the slicing-by-8 algorithm. (With the common defaults on
current operating systems, the runtime-check variant is what you get in
practice.)
Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
2015-04-14 16:05:03 +02:00
|
|
|
/* Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check. */
|
|
|
|
#if (_MSC_VER < 1500)
|
|
|
|
#define USE_SLICING_BY_8_CRC32C 1
|
2015-04-14 21:00:52 +02:00
|
|
|
#endif
|
Use Intel SSE 4.2 CRC instructions where available.
Modern x86 and x86-64 processors with SSE 4.2 support have special
instructions, crc32b and crc32q, for calculating CRC-32C. They greatly
speed up CRC calculation.
Whether the instructions can be used or not depends on the compiler and the
target architecture. If generation of SSE 4.2 instructions is allowed for
the target (-msse4.2 flag on gcc and clang), use them. If they are not
allowed by default, but the compiler supports the -msse4.2 flag to enable
them, compile just the CRC-32C function with -msse4.2 flag, and check at
runtime whether the processor we're running on supports it. If it doesn't,
fall back to the slicing-by-8 algorithm. (With the common defaults on
current operating systems, the runtime-check variant is what you get in
practice.)
Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
2015-04-14 16:05:03 +02:00
|
|
|
|
|
|
|
/* Define to 1 use Intel SSE 4.2 CRC instructions. */
|
|
|
|
/* #undef USE_SSE42_CRC32C */
|
|
|
|
|
|
|
|
/* Define to 1 to use Intel SSSE 4.2 CRC instructions with a runtime check. */
|
|
|
|
#if (_MSC_VER >= 1500)
|
|
|
|
#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
|
|
|
|
#endif
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Define to select SysV-style semaphores. */
|
2006-06-25 02:18:24 +02:00
|
|
|
/* #undef USE_SYSV_SEMAPHORES */
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to select SysV-style shared memory. */
|
|
|
|
#define USE_SYSV_SHARED_MEMORY 1
|
|
|
|
|
|
|
|
/* Define to select unnamed POSIX semaphores. */
|
|
|
|
/* #undef USE_UNNAMED_POSIX_SEMAPHORES */
|
|
|
|
|
Replace PostmasterRandom() with a stronger source, second attempt.
This adds a new routine, pg_strong_random() for generating random bytes,
for use in both frontend and backend. At the moment, it's only used in
the backend, but the upcoming SCRAM authentication patches need strong
random numbers in libpq as well.
pg_strong_random() is based on, and replaces, the existing implementation
in pgcrypto. It can acquire strong random numbers from a number of sources,
depending on what's available:
- OpenSSL RAND_bytes(), if built with OpenSSL
- On Windows, the native cryptographic functions are used
- /dev/urandom
Unlike the current pgcrypto function, the source is chosen by configure.
That makes it easier to test different implementations, and ensures that
we don't accidentally fall back to a less secure implementation, if the
primary source fails. All of those methods are quite reliable, it would be
pretty surprising for them to fail, so we'd rather find out by failing
hard.
If no strong random source is available, we fall back to using erand48(),
seeded from current timestamp, like PostmasterRandom() was. That isn't
cryptographically secure, but allows us to still work on platforms that
don't have any of the above stronger sources. Because it's not very secure,
the built-in implementation is only used if explicitly requested with
--disable-strong-random.
This replaces the more complicated Fortuna algorithm we used to have in
pgcrypto, which is unfortunate, but all modern platforms have /dev/urandom,
so it doesn't seem worth the maintenance effort to keep that. pgcrypto
functions that require strong random numbers will be disabled with
--disable-strong-random.
Original patch by Magnus Hagander, tons of further work by Michael Paquier
and me.
Discussion: https://www.postgresql.org/message-id/CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAB7nPqRWkNYRRPJA7-cF+LfroYV10pvjdz6GNvxk-Eee9FypKA@mail.gmail.com
2016-12-05 12:42:59 +01:00
|
|
|
/* Define to use native Windows API for random number generation */
|
|
|
|
#define USE_WIN32_RANDOM 1
|
|
|
|
|
2006-06-25 02:18:24 +02:00
|
|
|
/* Define to select Win32-style semaphores. */
|
2013-06-15 20:11:43 +02:00
|
|
|
#define USE_WIN32_SEMAPHORES 1
|
2006-06-25 02:18:24 +02:00
|
|
|
|
Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>.
Previously, we included <xlocale.h> only if necessary to get the definition
of type locale_t. According to notes in PGAC_TYPE_LOCALE_T, this is
important because on some versions of glibc that file supplies an
incompatible declaration of locale_t. (This info may be obsolete, because
on my RHEL6 box that seems to be the *only* definition of locale_t; but
there may still be glibc's in the wild for which it's a live concern.)
It turns out though that on FreeBSD and maybe other BSDen, you can get
locale_t from stdlib.h or locale.h but mbstowcs_l() and friends only from
<xlocale.h>. This was leaving us compiling calls to mbstowcs_l() and
friends with no visible prototype, which causes a warning and could
possibly cause actual trouble, since it's not declared to return int.
Hence, adjust the configure checks so that we'll include <xlocale.h>
either if it's necessary to get type locale_t or if it's necessary to
get a declaration of mbstowcs_l().
Report and patch by Aleksander Alekseev, somewhat whacked around by me.
Back-patch to all supported branches, since we have been using
mbstowcs_l() since 9.1.
2016-03-15 18:19:57 +01:00
|
|
|
/* Define to 1 if `wcstombs_l' requires <xlocale.h>. */
|
|
|
|
/* #undef WCSTOMBS_L_IN_XLOCALE */
|
|
|
|
|
2006-06-08 00:24:46 +02:00
|
|
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
|
|
/* #undef _FILE_OFFSET_BITS */
|
|
|
|
|
|
|
|
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
|
|
|
/* #undef _LARGEFILE_SOURCE */
|
|
|
|
|
|
|
|
/* Define for large files, on AIX-style hosts. */
|
|
|
|
/* #undef _LARGE_FILES */
|
|
|
|
|
2010-02-13 03:34:16 +01:00
|
|
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
|
|
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#define inline __inline
|
|
|
|
#endif
|
2006-06-08 00:24:46 +02:00
|
|
|
|
|
|
|
/* Define to empty if the C compiler does not understand signed types. */
|
|
|
|
/* #undef signed */
|
2017-03-09 21:18:59 +01:00
|
|
|
|
|
|
|
/* Define to how the compiler spells `typeof'. */
|
|
|
|
#define typeof decltype
|