mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 02:54:29 +08:00
Fix windows build (#322)
This commit is contained in:
@ -917,7 +917,8 @@ _mysql_string_literal(
|
||||
{
|
||||
PyObject *str, *s;
|
||||
char *in, *out;
|
||||
int len, size;
|
||||
unsigned long len;
|
||||
Py_ssize_t size;
|
||||
|
||||
if (self && PyModule_Check((PyObject*)self))
|
||||
self = NULL;
|
||||
@ -1986,12 +1987,10 @@ _mysql_ConnectionObject_repr(
|
||||
{
|
||||
char buf[300];
|
||||
if (self->open)
|
||||
sprintf(buf, "<_mysql.connection open to '%.256s' at %lx>",
|
||||
self->connection.host,
|
||||
(long)self);
|
||||
snprintf(buf, 300, "<_mysql.connection open to '%.256s' at %p>",
|
||||
self->connection.host, self);
|
||||
else
|
||||
sprintf(buf, "<_mysql.connection closed at %lx>",
|
||||
(long)self);
|
||||
snprintf(buf, 300, "<_mysql.connection closed at %p>", self);
|
||||
return PyString_FromString(buf);
|
||||
}
|
||||
|
||||
@ -2024,7 +2023,7 @@ _mysql_ResultObject_repr(
|
||||
_mysql_ResultObject *self)
|
||||
{
|
||||
char buf[300];
|
||||
sprintf(buf, "<_mysql.result object at %lx>", (long)self);
|
||||
snprintf(buf, 300, "<_mysql.result object at %p>", self);
|
||||
return PyString_FromString(buf);
|
||||
}
|
||||
|
||||
|
@ -11,21 +11,24 @@ def get_config():
|
||||
|
||||
extra_objects = []
|
||||
|
||||
if enabled(options, 'embedded'):
|
||||
client = "mysqld"
|
||||
else:
|
||||
client = "mysqlclient"
|
||||
# client = "mysqlclient"
|
||||
client = "mariadbclient"
|
||||
|
||||
vcversion = int(get_build_version())
|
||||
library_dirs = [ os.path.join(connector, r'lib\vs%d' % vcversion) ]
|
||||
libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
|
||||
include_dirs = [ os.path.join(connector, r'include') ]
|
||||
extra_compile_args = [ '/Zl' ]
|
||||
if client == "mariadbclient":
|
||||
library_dirs = [os.path.join(connector, 'lib', 'mariadb')]
|
||||
libraries = ['kernel32', 'advapi32', 'wsock32', 'shlwapi', 'Ws2_32', client ]
|
||||
include_dirs = [os.path.join(connector, 'include', 'mariadb')]
|
||||
else:
|
||||
library_dirs = [os.path.join(connector, r'lib\vs%d' % vcversion),
|
||||
os.path.join(connector, "lib")]
|
||||
libraries = ['kernel32', 'advapi32', 'wsock32', client ]
|
||||
include_dirs = [os.path.join(connector, r'include')]
|
||||
|
||||
extra_compile_args = ['/Zl', '/D_CRT_SECURE_NO_WARNINGS' ]
|
||||
extra_link_args = ['/MANIFEST']
|
||||
|
||||
name = "mysqlclient"
|
||||
if enabled(options, 'embedded'):
|
||||
name = name + "-embedded"
|
||||
metadata['name'] = name
|
||||
|
||||
define_macros = [
|
||||
|
Reference in New Issue
Block a user