$NetBSD: patch-aq,v 1.3 2011/07/06 09:45:45 obache Exp $

* use IPPROTO_TCP for SOL_TCP if it is not defined
  https://bugzilla.cyrusimap.org/show_bug.cgi?id=3300
* cast to unsigned long for platform sizeof(time_t) > sizeof(unsigned long).
  https://bugzilla.cyrusimap.org/show_bug.cgi?id=3376

--- imap/sync_client.c.orig	2011-07-04 15:05:01.000000000 +0000
+++ imap/sync_client.c
@@ -93,6 +93,10 @@
 #include "signals.h"
 #include "cyrusdb.h"
 
+#ifndef SOL_TCP
+#define SOL_TCP IPPROTO_TCP
+#endif
+
 /* signal to config.c */
 const int config_need_data = CONFIG_NEED_PARTITION_DATA;
 
@@ -911,7 +915,7 @@ static void log_record(const char *name,
     syslog(LOG_NOTICE, "SYNCNOTICE: %s uid:%u modseq:" MODSEQ_FMT " "
 	  "last_updated:%lu internaldate:%lu flags:(%s)",
 	   name, record->uid, record->modseq,
-	   record->last_updated, record->internaldate,
+	   (unsigned long)record->last_updated, (unsigned long)record->internaldate,
 	   make_flags(mailbox, record));
 }
 
