From 4fe2002b472457c74c6ba59f4ceec5606df6a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 8 Jan 2015 10:33:22 +0100 Subject: [PATCH] IMAP: fixed GCC4 build. --- .../mail_daemon/inbound_protocols/imap/IMAPFolder.h | 8 +++++++- .../mail_daemon/inbound_protocols/imap/IMAPMailbox.h | 6 +++++- .../mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h index 997b65cc10..f818cd814c 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2012-2015, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef IMAP_FOLDER_H @@ -15,6 +15,7 @@ #include +class BFile; class IMAPProtocol; @@ -94,8 +95,13 @@ private: size_t& length); private: +#if __GNUC__ >= 4 + typedef __gnu_cxx::hash_map UIDToFlagsMap; + typedef __gnu_cxx::hash_map UIDToRefMap; +#else typedef std::hash_map UIDToFlagsMap; typedef std::hash_map UIDToRefMap; +#endif IMAPProtocol& fProtocol; const entry_ref fRef; diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPMailbox.h b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPMailbox.h index d1fa8ede5b..ada972e76d 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPMailbox.h +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPMailbox.h @@ -1,5 +1,5 @@ /* - * Copyright 2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2013-2015, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef IMAP_MAILBOX_H @@ -53,7 +53,11 @@ protected: uint32 flags; uint32 size; }; +#if __GNUC__ >= 4 + typedef __gnu_cxx::hash_map MessageEntryMap; +#else typedef std::hash_map MessageEntryMap; +#endif IMAP::Protocol& fProtocol; BString fMailboxName; diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp index 17ccf2226c..a93cbdf908 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2013-2015, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -127,7 +127,7 @@ IMAPProtocol::MessageStored(IMAPFolder& folder, entry_ref& ref, BFile& stream, uint32 fetchFlags, BMessage& attributes) { if ((fetchFlags & (IMAP::kFetchHeader | IMAP::kFetchBody)) - == IMAP::kFetchHeader | IMAP::kFetchBody) { + == (IMAP::kFetchHeader | IMAP::kFetchBody)) { ProcessMessageFetched(ref, stream, attributes); } else if ((fetchFlags & IMAP::kFetchHeader) != 0) { ProcessHeaderFetched(ref, stream, attributes);