From 818ab021f5fbeeddaed001efd8716907e735bd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 26 Jul 2018 13:52:06 +0200 Subject: Compilation fix of qsql_mysql.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:78:21: error: conflicting declaration ‘using my_bool = bool’ using my_bool = bool; ^ In file included from /home/nierob/dev/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql_p.h:60, from /home/nierob/dev/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:40: /usr/include/mysql/mysql.h:53:14: note: previous declaration as ‘typedef char my_bool’ typedef char my_bool; ^~~~~~~ Seems that type was implemented with char not bool. Ammends 82b4c79fb90c1a01165b96455ae48715c3059bbe. Change-Id: Iccb70303a3af5c298922525b219dc6ed6168ba0b Reviewed-by: Samuel Gaist Reviewed-by: Edward Welbourne --- src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/sqldrivers/mysql') diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp index 7c0e270923..a1636302b7 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -74,9 +74,9 @@ Q_DECLARE_METATYPE(MYSQL_STMT*) # define Q_CLIENT_MULTI_STATEMENTS 0 #endif -#if MYSQL_VERSION_ID >= 80001 -using my_bool = bool; -#endif +// MySQL above version 8 removed my_bool typedef while MariaDB kept it, +// by redefining it we can regain source compatibility. +using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr)); QT_BEGIN_NAMESPACE -- cgit v1.2.3