summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-lobj.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-10-07 21:52:07 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-10-07 21:52:43 -0400
commit95d035e66d8e4371d35830d81f39face03cd4c45 (patch)
tree450c4e30491bd17f6499e8a33c094f9353238f79 /src/interfaces/libpq/fe-lobj.c
parentea72bb8ae527d371ccaf53647540a33224df92a6 (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/interfaces/libpq/fe-lobj.c')
-rw-r--r--src/interfaces/libpq/fe-lobj.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 022cfec0932..7c40100b86b 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -187,7 +187,6 @@ lo_truncate(PGconn *conn, int fd, size_t len)
* returns 0 upon success
* returns -1 upon failure
*/
-#ifdef HAVE_PG_INT64
int
lo_truncate64(PGconn *conn, int fd, pg_int64 len)
{
@@ -232,7 +231,6 @@ lo_truncate64(PGconn *conn, int fd, pg_int64 len)
return -1;
}
}
-#endif
/*
* lo_read
@@ -325,10 +323,7 @@ lo_write(PGconn *conn, int fd, const char *buf, size_t len)
/*
* lo_lseek
* change the current read or write location on a large object
- * currently, only L_SET is a legal value for whence
- *
*/
-
int
lo_lseek(PGconn *conn, int fd, int offset, int whence)
{
@@ -372,11 +367,7 @@ lo_lseek(PGconn *conn, int fd, int offset, int whence)
/*
* lo_lseek64
* change the current read or write location on a large object
- * currently, only L_SET is a legal value for whence
- *
*/
-
-#ifdef HAVE_PG_INT64
pg_int64
lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence)
{
@@ -424,7 +415,6 @@ lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence)
return -1;
}
}
-#endif
/*
* lo_creat
@@ -554,9 +544,7 @@ lo_tell(PGconn *conn, int fd)
/*
* lo_tell64
* returns the current seek location of the large object
- *
*/
-#ifdef HAVE_PG_INT64
pg_int64
lo_tell64(PGconn *conn, int fd)
{
@@ -595,12 +583,10 @@ lo_tell64(PGconn *conn, int fd)
return -1;
}
}
-#endif
/*
* lo_unlink
* delete a file
- *
*/
int
@@ -1031,6 +1017,7 @@ lo_initialize(PGconn *conn)
return -1;
}
}
+
/*
* Put the structure into the connection control
*/