From 7cf7f503cf8b615f28bd2a9ba098da7ed21f0cf4 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 24 Jun 2016 14:07:14 +0200 Subject: [PATCH] Fix build on bb10 (however iconv is now not used on bb10, so let's hope they are using UTF-8 locales). --- coreapi/message_storage.c | 10 ++++++---- coreapi/sqlite3_bctbx_vfs.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index 161a9f322..e60223486 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _WIN32 #if !defined(__QNXNTO__) -# include -# include -# include -# include +#include +#include +#include +#include #endif #else #include @@ -50,6 +50,8 @@ static char *utf8_convert(const char *filename){ wchar_t db_file_utf16[MAX_PATH_SIZE]={0}; MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, filename, -1, db_file_utf16, MAX_PATH_SIZE); WideCharToMultiByte(CP_UTF8, 0, db_file_utf16, -1, db_file_utf8, sizeof(db_file_utf8), NULL, NULL); +#elif defined(__QNXNTO__) + strncpy(db_file_utf8, filename, MAX_PATH_SIZE - 1); #else char db_file_locale[MAX_PATH_SIZE] = {'\0'}; char *inbuf=db_file_locale, *outbuf=db_file_utf8; diff --git a/coreapi/sqlite3_bctbx_vfs.c b/coreapi/sqlite3_bctbx_vfs.c index d9abfad10..efd6405dd 100755 --- a/coreapi/sqlite3_bctbx_vfs.c +++ b/coreapi/sqlite3_bctbx_vfs.c @@ -259,6 +259,8 @@ static char* ConvertFromUtf8Filename(const char* fName){ } bctbx_free(wideFilename); return convertedFilename; +#elif defined(__QNXNTO__) + return bctbx_strdup(fName); #else #define MAX_PATH_SIZE 1024 char db_file_utf8[MAX_PATH_SIZE] = {'\0'}; @@ -277,8 +279,6 @@ static char* ConvertFromUtf8Filename(const char* fName){ } return bctbx_strdup(db_file_locale); #endif - - } #endif /**