summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-04-29 04:26:29 (GMT)
committerBill King <bill.king@nokia.com>2009-04-29 04:26:29 (GMT)
commit822114e976d7c6644f060ac366c08c92da1a4779 (patch)
treeb4631852049de35477379834090ba5af4b3f0dbe /src/sql
parente378783811b2ace2379becefd1e479ce840f2850 (diff)
downloadQt-822114e976d7c6644f060ac366c08c92da1a4779.zip
Qt-822114e976d7c6644f060ac366c08c92da1a4779.tar.gz
Qt-822114e976d7c6644f060ac366c08c92da1a4779.tar.bz2
Try and clean up ODBC 64/32 bit type disparity
It seems that after approx version 2.7.0, microsoft changed the ODBC types of certain functions, to cater for 64bit architectures. This tries to be a little bit smarter about which types are used in which places.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 2a83fe6..4e90777 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -70,18 +70,16 @@ QT_BEGIN_NAMESPACE
#endif
// newer platform SDKs use SQLLEN instead of SQLINTEGER
-#if defined(SQLLEN) || defined(Q_OS_WIN64)
+//#if defined(SQLLEN) || defined(Q_OS_WIN64)
+#if ODBCVER >= 0x0270
# define QSQLLEN SQLLEN
-#else
-# define QSQLLEN SQLINTEGER
-#endif
-
-#if defined(SQLULEN) || defined(Q_OS_WIN64)
# define QSQLULEN SQLULEN
#else
+# define QSQLLEN SQLINTEGER
# define QSQLULEN SQLUINTEGER
#endif
+
static const int COLNAMESIZE = 256;
//Map Qt parameter types to ODBC types
static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT };