diff --git a/build/wp8/LibLinphone.vcxproj b/build/wp8/LibLinphone.vcxproj
index 7d8d4b014..f1bdecc0d 100644
--- a/build/wp8/LibLinphone.vcxproj
+++ b/build/wp8/LibLinphone.vcxproj
@@ -53,7 +53,7 @@
Level4
- $(ProjectDir)..\..\..\belle-sip\include;$(ProjectDir)..\..\oRTP\include;$(ProjectDir)..\..\mediastreamer2\include;$(ProjectDir)..\..\..\tunnel\include;$(ProjectDir)..\..\coreapi;$(ProjectDir)..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;$(ProjectDir)..\..\..\zlib;%(AdditionalIncludeDirectories)
+ $(ProjectDir)..\..\..\belle-sip\include;$(ProjectDir)..\..\oRTP\include;$(ProjectDir)..\..\mediastreamer2\include;$(ProjectDir)..\..\..\tunnel\include;$(ProjectDir)..\..\coreapi;$(ProjectDir)..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;$(ProjectDir)..\..\..\zlib;$(ProjectDir)..\..\..\sqlite\;%(AdditionalIncludeDirectories)
__STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR=".";UNICODE;_XKEYCHECK_H;HAVE_ZLIB;%(PreprocessorDefinitions)
Default
NotUsing
@@ -74,7 +74,7 @@
- _DEBUG;%(PreprocessorDefinitions)
+ _DEBUG;MSG_STORAGE_ENABLED;%(PreprocessorDefinitions)
true
@@ -82,7 +82,7 @@
- NDEBUG;%(PreprocessorDefinitions)
+ NDEBUG;MSG_STORAGE_ENABLED;%(PreprocessorDefinitions)
MaxSpeed
true
true
@@ -189,6 +189,9 @@
{0565952a-ea62-46a2-8261-f5b4b490da42}
+
+ {a45d63b9-60de-476c-8836-f8eedbe139d0}
+
{59500dd1-b192-4ddf-a402-8a8e3739e032}
diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c
index c87891a34..81e3c0415 100644
--- a/coreapi/message_storage.c
+++ b/coreapi/message_storage.c
@@ -21,10 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphonecore.h"
#ifdef MSG_STORAGE_ENABLED
+#ifndef PRIu64
+#define PRIu64 "I64u"
+#endif
#include "sqlite3.h"
-static inline LinphoneChatMessage* get_transient_message(LinphoneChatRoom* cr, unsigned int storage_id){
+static ORTP_INLINE LinphoneChatMessage* get_transient_message(LinphoneChatRoom* cr, unsigned int storage_id){
MSList* transients = cr->transient_messages;
LinphoneChatMessage* chat;
while( transients ){
@@ -225,7 +228,7 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(msg->chat_room));
local_contact=linphone_address_as_string_uri_only(linphone_chat_message_get_local_address(msg));
- buf=sqlite3_mprintf("INSERT INTO history VALUES(NULL,%Q,%Q,%i,%Q,%Q,%i,%i,%Q,%i,%Q,%i);",
+ buf = sqlite3_mprintf("INSERT INTO history VALUES(NULL,%Q,%Q,%i,%Q,%Q,%i,%i,%Q,%lld,%Q,%i);",
local_contact,
peer,
msg->dir,
@@ -250,7 +253,7 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
void linphone_chat_message_store_state(LinphoneChatMessage *msg){
LinphoneCore *lc=msg->chat_room->lc;
if (lc->db){
- char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE (id = %i) AND utc = %i;",
+ char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE (id = %i) AND utc = %lld;",
msg->state,msg->storage_id,msg->time);
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
@@ -459,7 +462,7 @@ static int migrate_messages_timestamp(void* data,int argc, char** argv, char** c
time_t new_time = parse_time_from_db(argv[1]);
if( new_time ){
/* replace 'time' by -1 and set 'utc' to the timestamp */
- char *buf = sqlite3_mprintf("UPDATE history SET utc=%i,time='-1' WHERE id=%i;", new_time, atoi(argv[0]));
+ char *buf = sqlite3_mprintf("UPDATE history SET utc=%lld,time='-1' WHERE id=%i;", new_time, atoi(argv[0]));
if( buf) {
linphone_sql_request((sqlite3*)data, buf);
sqlite3_free(buf);
@@ -486,7 +489,7 @@ static void linphone_migrate_timestamps(sqlite3* db){
uint64_t end;
linphone_sql_request(db, "COMMIT");
end=ortp_get_cur_time_ms();
- ms_message("Migrated message timestamps to UTC in %i ms",(int)(end-begin));
+ ms_message("Migrated message timestamps to UTC in %lld ms",(end-begin));
}
}