mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-02 02:33:06 +03:00
Windows doesn't like the name "connect" for a function
This commit is contained in:
parent
dc5dd30526
commit
458254c49e
|
@ -76,11 +76,11 @@ HIDDEN PyObject *psyco_null = NULL;
|
||||||
#define str(s) #s
|
#define str(s) #s
|
||||||
|
|
||||||
/** connect module-level function **/
|
/** connect module-level function **/
|
||||||
#define connect_doc \
|
#define psyco_connect_doc \
|
||||||
"_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n"
|
"_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n"
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
connect(PyObject *self, PyObject *args, PyObject *keywds)
|
psyco_connect(PyObject *self, PyObject *args, PyObject *keywds)
|
||||||
{
|
{
|
||||||
PyObject *conn = NULL;
|
PyObject *conn = NULL;
|
||||||
PyObject *factory = NULL;
|
PyObject *factory = NULL;
|
||||||
|
@ -96,7 +96,7 @@ connect(PyObject *self, PyObject *args, PyObject *keywds)
|
||||||
|
|
||||||
if (async_) { async = async_; }
|
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 */
|
/* allocate connection, fill with errors and return it */
|
||||||
if (factory == NULL || factory == Py_None) {
|
if (factory == NULL || factory == Py_None) {
|
||||||
|
@ -986,8 +986,8 @@ mxdatetime_init(PyObject *module)
|
||||||
/** method table and module initialization **/
|
/** method table and module initialization **/
|
||||||
|
|
||||||
static PyMethodDef psycopgMethods[] = {
|
static PyMethodDef psycopgMethods[] = {
|
||||||
{"_connect", (PyCFunction)connect,
|
{"_connect", (PyCFunction)psyco_connect,
|
||||||
METH_VARARGS|METH_KEYWORDS, connect_doc},
|
METH_VARARGS|METH_KEYWORDS, psyco_connect_doc},
|
||||||
{"parse_dsn", (PyCFunction)parse_dsn,
|
{"parse_dsn", (PyCFunction)parse_dsn,
|
||||||
METH_VARARGS|METH_KEYWORDS, parse_dsn_doc},
|
METH_VARARGS|METH_KEYWORDS, parse_dsn_doc},
|
||||||
{"quote_ident", (PyCFunction)quote_ident,
|
{"quote_ident", (PyCFunction)quote_ident,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user