diff options
author | Tom Lane | 2012-10-08 01:52:07 +0000 |
---|---|---|
committer | Tom Lane | 2012-10-08 01:52:43 +0000 |
commit | 95d035e66d8e4371d35830d81f39face03cd4c45 (patch) | |
tree | 450c4e30491bd17f6499e8a33c094f9353238f79 /src/include/c.h | |
parent | ea72bb8ae527d371ccaf53647540a33224df92a6 (diff) |
Autoconfiscate selection of 64-bit int type for 64-bit large object API.
Get rid of the fundamentally indefensible assumption that "long long int"
exists and is exactly 64 bits wide on every platform Postgres runs on.
Instead let the configure script select the type to use for "pg_int64".
This is a bit of a pain in the rear since we do not want to pollute client
namespace with all the random symbols that pg_config.h defines; instead
we have to create a separate generated header file, "pg_config_ext.h".
But now that the infrastructure is there, we might have the ability to
add some other stuff that's long been wanting in this area.
Diffstat (limited to 'src/include/c.h')
-rw-r--r-- | src/include/c.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/include/c.h b/src/include/c.h index bec1eb3da46..127b5d94e3c 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -44,19 +44,17 @@ #ifndef C_H #define C_H -/* - * We have to include stdlib.h here because it defines many of these macros - * on some platforms, and we only want our definitions used if stdlib.h doesn't - * have its own. The same goes for stddef and stdarg if present. - */ +#include "postgres_ext.h" + +/* Must undef pg_config_ext.h symbols before including pg_config.h */ +#undef PG_INT64_TYPE #include "pg_config.h" #include "pg_config_manual.h" /* must be after pg_config.h */ -#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 will include further - * down */ + +#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 includes further down */ #include "pg_config_os.h" /* must be before any system header files */ #endif -#include "postgres_ext.h" #if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H) #define errcode __msvc_errcode @@ -64,6 +62,12 @@ #undef errcode #endif +/* + * We have to include stdlib.h here because it defines many of these macros + * on some platforms, and we only want our definitions used if stdlib.h doesn't + * have its own. The same goes for stddef and stdarg if present. + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> |