From 5c7f1083c78802cf0be981aa8e6098a4ef4e05ad Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 26 Aug 2022 18:13:24 +0200 Subject: [PATCH] database_connection.cpp: Fix compil issues on msys2. these issues are due to "old" (or not existing) types used in sql.h --- common/database/database_connection.cpp | 16 +++++++++++++++- include/fmt.h | 3 ++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/common/database/database_connection.cpp b/common/database/database_connection.cpp index 51f7f81b1c..00892ecfbc 100644 --- a/common/database/database_connection.cpp +++ b/common/database/database_connection.cpp @@ -21,7 +21,21 @@ #include #include #include + +// Some outdated definitions are used in sql.h +// We need to define them for "recent" dev tools +#define INT64 int64_t +#define UINT64 uint64_t + +#ifdef __MINGW32__ +#define BYTE uint8_t +#define WORD uint16_t +#define DWORD uint32_t +#define HWND uint32_t /* dummy define */ +#endif + #include // SQL_IDENTIFIER_QUOTE_CHAR + #include #include @@ -203,7 +217,7 @@ bool DATABASE_CONNECTION::cacheColumns() std::string columnKey = toUTF8( columns.column_name() ); m_columnCache[tableIter.first][columnKey] = columns.data_type(); } - + } catch( nanodbc::database_error& e ) { diff --git a/include/fmt.h b/include/fmt.h index 76f119e8d1..7de568b8ea 100644 --- a/include/fmt.h +++ b/include/fmt.h @@ -23,7 +23,8 @@ #include #include -#include + +#include // {fmt} formatter for wxString FMT_BEGIN_NAMESPACE