summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 2670914b78..35eb09e584 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -63,6 +63,7 @@
#define PGSQL_MAX_LENGTH_OF_LONG 30
#define PGSQL_MAX_LENGTH_OF_DOUBLE 60
+#if LONG_MAX < UINT_MAX
#define PGSQL_RETURN_OID(oid) do { \
if (oid > LONG_MAX) { \
smart_str s = {0}; \
@@ -72,7 +73,9 @@
} \
RETURN_LONG((long)oid); \
} while(0)
-
+#else
+#define PGSQL_RETURN_OID(oid) (RETURN_LONG((long)oid))
+#endif
#if HAVE_PQSETNONBLOCKING
#define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag)