From 458254c49e3852f9268a6f18cccb83ada8ed81f6 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 17 Mar 2019 22:26:02 +0000 Subject: Windows doesn't like the name "connect" for a function --- psycopg/psycopgmodule.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'psycopg') diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index 0dde27c..8ee2328 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -76,11 +76,11 @@ HIDDEN PyObject *psyco_null = NULL; #define str(s) #s /** connect module-level function **/ -#define connect_doc \ +#define psyco_connect_doc \ "_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n" static PyObject * -connect(PyObject *self, PyObject *args, PyObject *keywds) +psyco_connect(PyObject *self, PyObject *args, PyObject *keywds) { PyObject *conn = NULL; PyObject *factory = NULL; @@ -96,7 +96,7 @@ connect(PyObject *self, PyObject *args, PyObject *keywds) if (async_) { async = async_; } - Dprintf("connect: dsn = '%s', async = %d", dsn, async); + Dprintf("psyco_connect: dsn = '%s', async = %d", dsn, async); /* allocate connection, fill with errors and return it */ if (factory == NULL || factory == Py_None) { @@ -986,8 +986,8 @@ mxdatetime_init(PyObject *module) /** method table and module initialization **/ static PyMethodDef psycopgMethods[] = { - {"_connect", (PyCFunction)connect, - METH_VARARGS|METH_KEYWORDS, connect_doc}, + {"_connect", (PyCFunction)psyco_connect, + METH_VARARGS|METH_KEYWORDS, psyco_connect_doc}, {"parse_dsn", (PyCFunction)parse_dsn, METH_VARARGS|METH_KEYWORDS, parse_dsn_doc}, {"quote_ident", (PyCFunction)quote_ident, -- cgit v1.2.1