From 3643d21756a6bd9ed06a409457d6e8c93aba3b43 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 29 Jul 2010 11:15:00 +0200 Subject: fixes for using freetds DBNTWIN32 only if not Q_USE_SYBASE. Workaround for RETCODE typedef conflict between ODBC and FreeTDS. Include winsock2.h supplies SOCKET for FreeTDS. Merge-request: 684 Reviewed-by: Oswald Buddenhagen --- src/sql/drivers/tds/qsql_tds.h | 3 +++ src/sql/kernel/qsqldatabase.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h index f23a672..3594a4d 100644 --- a/src/sql/drivers/tds/qsql_tds.h +++ b/src/sql/drivers/tds/qsql_tds.h @@ -48,7 +48,10 @@ #ifdef Q_OS_WIN32 #define WIN32_LEAN_AND_MEAN +#ifndef Q_USE_SYBASE #define DBNTWIN32 // indicates 32bit windows dblib +#endif +#include #include #include #include diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 76bc2b0..2ab37de 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -60,7 +60,10 @@ #include "../drivers/oci/qsql_oci.h" #endif #ifdef QT_SQL_TDS +// conflicting RETCODE typedef between odbc and freetds +#define RETCODE DBRETCODE #include "../drivers/tds/qsql_tds.h" +#undef RETCODE #endif #ifdef QT_SQL_DB2 #include "../drivers/db2/qsql_db2.h" -- cgit v0.12