mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Merge branch 'msvc-cleanup' into devel
Merged Jason Erickson devel branch after collapsing a few commits together where it made sense.
This commit is contained in:
commit
194447fbbf
|
@ -51,6 +51,10 @@ extern HIDDEN int psycopg_debug_enabled;
|
|||
#else /* !__GNUC__ or __APPLE__ */
|
||||
#ifdef PSYCOPG_DEBUG
|
||||
#include <stdarg.h>
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#define getpid _getpid
|
||||
#endif
|
||||
static void Dprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
|
@ -939,7 +939,7 @@ connection_repr(connectionObject *self)
|
|||
static int
|
||||
connection_traverse(connectionObject *self, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(self->tpc_xid);
|
||||
Py_VISIT((PyObject *)(self->tpc_xid));
|
||||
Py_VISIT(self->async_cursor);
|
||||
Py_VISIT(self->notice_list);
|
||||
Py_VISIT(self->notice_filter);
|
||||
|
|
|
@ -124,10 +124,11 @@ static PyObject *
|
|||
psyco_lobj_read(lobjectObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *res;
|
||||
int where, end, size = -1;
|
||||
int where, end;
|
||||
Py_ssize_t size = -1;
|
||||
char *buffer;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i", &size)) return NULL;
|
||||
if (!PyArg_ParseTuple(args, "|" CONV_CODE_PY_SSIZE_T, &size)) return NULL;
|
||||
|
||||
EXC_IF_LOBJ_CLOSED(self);
|
||||
EXC_IF_LOBJ_LEVEL0(self);
|
||||
|
|
|
@ -100,7 +100,8 @@ static int
|
|||
xid_init(XidObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = {"format_id", "gtrid", "bqual", NULL};
|
||||
int format_id, i, gtrid_len, bqual_len;
|
||||
int format_id;
|
||||
size_t i, gtrid_len, bqual_len;
|
||||
const char *gtrid, *bqual;
|
||||
PyObject *tmp;
|
||||
|
||||
|
|
15
setup.py
15
setup.py
|
@ -155,6 +155,13 @@ class psycopg_build_ext(build_ext):
|
|||
def get_pg_config(self, kind):
|
||||
return get_pg_config(kind, self.pg_config)
|
||||
|
||||
def get_export_symbols(self, ext):
|
||||
# Fix MSVC seeing two of the same export symbols.
|
||||
if self.get_compiler().lower().startswith('msvc'):
|
||||
return []
|
||||
else:
|
||||
return build_ext.get_export_symbols(self, ext)
|
||||
|
||||
def build_extension(self, ext):
|
||||
build_ext.build_extension(self, ext)
|
||||
|
||||
|
@ -181,13 +188,7 @@ class psycopg_build_ext(build_ext):
|
|||
compiler_name = self.get_compiler().lower()
|
||||
compiler_is_msvc = compiler_name.startswith('msvc')
|
||||
compiler_is_mingw = compiler_name.startswith('mingw')
|
||||
if compiler_is_msvc:
|
||||
# If we're using MSVC 7.1 or later on a 32-bit platform, add the
|
||||
# /Wp64 option to generate warnings about Win64 portability
|
||||
# problems.
|
||||
if sysVer >= (2,4) and struct.calcsize('P') == 4:
|
||||
extra_compiler_args.append('/Wp64')
|
||||
elif compiler_is_mingw:
|
||||
if compiler_is_mingw:
|
||||
# Default MinGW compilation of Python extensions on Windows uses
|
||||
# only -O:
|
||||
extra_compiler_args.append('-O3')
|
||||
|
|
Loading…
Reference in New Issue
Block a user