diff --git a/psycopg/lobject_int.c b/psycopg/lobject_int.c index f66d9498..86aa9012 100644 --- a/psycopg/lobject_int.c +++ b/psycopg/lobject_int.c @@ -389,7 +389,7 @@ lobject_seek(lobjectObject *self, long pos, int whence) Py_BEGIN_ALLOW_THREADS; pthread_mutex_lock(&(self->conn->lock)); -#if HAVE_LO64 +#ifdef HAVE_LO64 if (self->conn->server_version < 90300) { where = (long)lo_lseek(self->conn->pgconn, self->fd, (int)pos, whence); } else { @@ -424,7 +424,7 @@ lobject_tell(lobjectObject *self) Py_BEGIN_ALLOW_THREADS; pthread_mutex_lock(&(self->conn->lock)); -#if HAVE_LO64 +#ifdef HAVE_LO64 if (self->conn->server_version < 90300) { where = (long)lo_tell(self->conn->pgconn, self->fd); } else { @@ -489,7 +489,7 @@ lobject_truncate(lobjectObject *self, size_t len) Py_BEGIN_ALLOW_THREADS; pthread_mutex_lock(&(self->conn->lock)); -#if HAVE_LO64 +#ifdef HAVE_LO64 if (self->conn->server_version < 90300) { retvalue = lo_truncate(self->conn->pgconn, self->fd, len); } else { diff --git a/psycopg/lobject_type.c b/psycopg/lobject_type.c index 82aa186d..a25240c1 100644 --- a/psycopg/lobject_type.c +++ b/psycopg/lobject_type.c @@ -175,7 +175,7 @@ psyco_lobj_seek(lobjectObject *self, PyObject *args) EXC_IF_LOBJ_LEVEL0(self); EXC_IF_LOBJ_UNMARKED(self); -#if !HAVE_LO64 +#ifndef HAVE_LO64 if (offset > INT_MAX) { psyco_set_error(InterfaceError, NULL, "offset out of range"); @@ -272,7 +272,7 @@ psyco_lobj_truncate(lobjectObject *self, PyObject *args) EXC_IF_LOBJ_LEVEL0(self); EXC_IF_LOBJ_UNMARKED(self); -#if !HAVE_LO64 +#ifndef HAVE_LO64 if (len > INT_MAX) { psyco_set_error(InterfaceError, NULL, "len out of range"); diff --git a/setup.py b/setup.py index 9e797cda..647a532f 100644 --- a/setup.py +++ b/setup.py @@ -422,8 +422,6 @@ class psycopg_build_ext(build_ext): # enable lo64 if postgres >= 9.3 if (pgmajor, pgminor) >= (9, 3): define_macros.append(("HAVE_LO64", "1")) - else: - define_macros.append(("HAVE_LO64", "0")) except Warning: w = sys.exc_info()[1] # work around py 2/3 different syntax