mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -23,6 +23,8 @@
|
||||
#ifndef POSTGRES_EXT_H
|
||||
#define POSTGRES_EXT_H
|
||||
|
||||
#include "pg_config_ext.h"
|
||||
|
||||
/*
|
||||
* Object ID is a fundamental type in Postgres.
|
||||
*/
|
||||
@ -37,6 +39,9 @@ typedef unsigned int Oid;
|
||||
#define OID_MAX UINT_MAX
|
||||
/* you will need to include <limits.h> to use the above #define */
|
||||
|
||||
/* Define a signed 64-bit integer type for use in client API declarations. */
|
||||
typedef PG_INT64_TYPE pg_int64;
|
||||
|
||||
|
||||
/*
|
||||
* Identifiers of error message fields. Kept here to keep common
|
||||
@ -56,9 +61,4 @@ typedef unsigned int Oid;
|
||||
#define PG_DIAG_SOURCE_LINE 'L'
|
||||
#define PG_DIAG_SOURCE_FUNCTION 'R'
|
||||
|
||||
#ifndef NO_PG_INT64
|
||||
#define HAVE_PG_INT64 1
|
||||
typedef long long int pg_int64;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* POSTGRES_EXT_H */
|
||||
|
Reference in New Issue
Block a user