aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exception.cpp24
-rw-r--r--src/fileAttachment.cpp10
-rw-r--r--src/net/builtinServices.inl10
-rw-r--r--src/net/defaultConnectionInfos.cpp8
-rw-r--r--src/net/events.cpp10
-rw-r--r--src/net/folder.cpp10
-rw-r--r--src/net/imap/IMAPConnection.cpp10
-rw-r--r--src/net/imap/IMAPFolder.cpp10
-rw-r--r--src/net/imap/IMAPMessage.cpp11
-rw-r--r--src/net/imap/IMAPMessagePartContentHandler.cpp9
-rw-r--r--src/net/imap/IMAPPart.cpp9
-rw-r--r--src/net/imap/IMAPSStore.cpp10
-rw-r--r--src/net/imap/IMAPServiceInfos.cpp9
-rw-r--r--src/net/imap/IMAPStore.cpp10
-rw-r--r--src/net/imap/IMAPStructure.cpp9
-rw-r--r--src/net/imap/IMAPTag.cpp10
-rw-r--r--src/net/imap/IMAPUtils.cpp10
-rw-r--r--src/net/maildir/format/courierMaildirFormat.cpp9
-rw-r--r--src/net/maildir/format/kmailMaildirFormat.cpp9
-rw-r--r--src/net/maildir/maildirFolder.cpp10
-rw-r--r--src/net/maildir/maildirFormat.cpp9
-rw-r--r--src/net/maildir/maildirMessage.cpp10
-rw-r--r--src/net/maildir/maildirServiceInfos.cpp9
-rw-r--r--src/net/maildir/maildirStore.cpp10
-rw-r--r--src/net/maildir/maildirUtils.cpp12
-rw-r--r--src/net/message.cpp10
-rw-r--r--src/net/pop3/POP3Folder.cpp10
-rw-r--r--src/net/pop3/POP3Message.cpp10
-rw-r--r--src/net/pop3/POP3SStore.cpp9
-rw-r--r--src/net/pop3/POP3ServiceInfos.cpp9
-rw-r--r--src/net/pop3/POP3Store.cpp9
-rw-r--r--src/net/pop3/POP3Utils.cpp9
-rw-r--r--src/net/sendmail/sendmailServiceInfos.cpp9
-rw-r--r--src/net/sendmail/sendmailTransport.cpp12
-rw-r--r--src/net/service.cpp9
-rw-r--r--src/net/serviceFactory.cpp11
-rw-r--r--src/net/serviceInfos.cpp9
-rw-r--r--src/net/session.cpp10
-rw-r--r--src/net/smtp/SMTPResponse.cpp9
-rw-r--r--src/net/smtp/SMTPSTransport.cpp9
-rw-r--r--src/net/smtp/SMTPServiceInfos.cpp9
-rw-r--r--src/net/smtp/SMTPTransport.cpp10
-rw-r--r--src/net/tls/TLSSecuredConnectionInfos.cpp9
-rw-r--r--src/net/tls/TLSSession.cpp16
-rw-r--r--src/net/tls/TLSSocket.cpp9
-rw-r--r--src/net/transport.cpp9
-rw-r--r--src/platform.cpp40
-rw-r--r--src/platforms/posix/posixChildProcess.cpp9
-rw-r--r--src/platforms/posix/posixFile.cpp11
-rw-r--r--src/platforms/posix/posixHandler.cpp9
-rw-r--r--src/platforms/posix/posixSocket.cpp11
-rw-r--r--src/platforms/windows/windowsFile.cpp12
-rw-r--r--src/platforms/windows/windowsHandler.cpp11
-rw-r--r--src/platforms/windows/windowsSocket.cpp10
-rw-r--r--src/security/defaultAuthenticator.cpp9
-rw-r--r--src/security/sasl/SASLContext.cpp9
-rw-r--r--src/security/sasl/SASLMechanismFactory.cpp9
-rw-r--r--src/security/sasl/SASLSession.cpp9
-rw-r--r--src/security/sasl/SASLSocket.cpp9
-rw-r--r--src/security/sasl/builtinSASLMechanism.cpp9
-rw-r--r--src/security/sasl/defaultSASLAuthenticator.cpp9
-rw-r--r--src/utility/encoder/uuEncoder.cpp12
62 files changed, 599 insertions, 52 deletions
diff --git a/src/exception.cpp b/src/exception.cpp
index 60ec95b4..fd223b2a 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -334,6 +334,18 @@ exception* system_error::clone() const { return new system_error(*this); }
const char* system_error::name() const throw() { return "system_error"; }
+//
+// malformed_url
+//
+
+malformed_url::~malformed_url() throw() {}
+malformed_url::malformed_url(const string& error, const exception& other)
+ : exception("Malformed URL: " + error + ".", other) {}
+
+exception* malformed_url::clone() const { return new malformed_url(*this); }
+const char* malformed_url::name() const throw() { return "malformed_url"; }
+
+
#if VMIME_HAVE_MESSAGING_FEATURES
@@ -610,18 +622,6 @@ const char* partial_fetch_not_supported::name() const throw() { return "partial_
//
-// malformed_url
-//
-
-malformed_url::~malformed_url() throw() {}
-malformed_url::malformed_url(const string& error, const exception& other)
- : net_exception("Malformed URL: " + error + ".", other) {}
-
-exception* malformed_url::clone() const { return new malformed_url(*this); }
-const char* malformed_url::name() const throw() { return "malformed_url"; }
-
-
-//
// invalid_folder_name
//
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index cb23cd04..6f9a72bf 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include <fstream>
#include <sstream>
@@ -211,3 +217,7 @@ void fileAttachment::fileInfo::setSize(const unsigned int& size) { if (m_size) {
} // vmime
+
+
+#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/net/builtinServices.inl b/src/net/builtinServices.inl
index 4a6ac873..aba4cd3a 100644
--- a/src/net/builtinServices.inl
+++ b/src/net/builtinServices.inl
@@ -29,7 +29,7 @@
#ifndef VMIME_BUILDING_DOC
-#if VMIME_BUILTIN_MESSAGING_PROTO_POP3
+#if VMIME_HAVE_MESSAGING_PROTO_POP3
#include "vmime/net/pop3/POP3Store.hpp"
REGISTER_SERVICE(pop3::POP3Store, pop3, TYPE_STORE);
@@ -40,7 +40,7 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_SMTP
+#if VMIME_HAVE_MESSAGING_PROTO_SMTP
#include "vmime/net/smtp/SMTPTransport.hpp"
REGISTER_SERVICE(smtp::SMTPTransport, smtp, TYPE_TRANSPORT);
@@ -51,7 +51,7 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_IMAP
+#if VMIME_HAVE_MESSAGING_PROTO_IMAP
#include "vmime/net/imap/IMAPStore.hpp"
REGISTER_SERVICE(imap::IMAPStore, imap, TYPE_STORE);
@@ -62,12 +62,12 @@
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_MAILDIR
+#if VMIME_HAVE_MESSAGING_PROTO_MAILDIR
#include "vmime/net/maildir/maildirStore.hpp"
REGISTER_SERVICE(maildir::maildirStore, maildir, TYPE_STORE);
#endif
-#if VMIME_BUILTIN_MESSAGING_PROTO_SENDMAIL
+#if VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
#include "vmime/net/sendmail/sendmailTransport.hpp"
REGISTER_SERVICE(sendmail::sendmailTransport, sendmail, TYPE_TRANSPORT);
#endif
diff --git a/src/net/defaultConnectionInfos.cpp b/src/net/defaultConnectionInfos.cpp
index 41f1e0fd..6c699f23 100644
--- a/src/net/defaultConnectionInfos.cpp
+++ b/src/net/defaultConnectionInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/defaultConnectionInfos.hpp"
@@ -50,3 +56,5 @@ port_t defaultConnectionInfos::getPort() const
} // vmime
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/events.cpp b/src/net/events.cpp
index 52c13eef..32ab2cfb 100644
--- a/src/net/events.cpp
+++ b/src/net/events.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/events.hpp"
#include "vmime/net/folder.hpp"
@@ -113,3 +119,7 @@ void folderEvent::dispatch(folderListener* listener) const
} // events
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/folder.cpp b/src/net/folder.cpp
index 47ec3170..e4b7cdd0 100644
--- a/src/net/folder.cpp
+++ b/src/net/folder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/folder.hpp"
#include <algorithm>
@@ -98,3 +104,7 @@ void folder::notifyFolder(const events::folderEvent& event)
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index e2b60ed9..9cb81d8c 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPTag.hpp"
#include "vmime/net/imap/IMAPConnection.hpp"
#include "vmime/net/imap/IMAPUtils.hpp"
@@ -727,3 +733,7 @@ ref <const socket> IMAPConnection::getSocket() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index 3d8c17ea..8eac9eae 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPFolder.hpp"
#include "vmime/net/imap/IMAPStore.hpp"
@@ -1936,3 +1942,7 @@ std::vector <int> IMAPFolder::getMessageNumbersStartingOnUID(const message::uid&
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 808f7d1d..45d4699b 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPParser.hpp"
#include "vmime/net/imap/IMAPMessage.hpp"
#include "vmime/net/imap/IMAPFolder.hpp"
@@ -316,7 +322,7 @@ void IMAPMessage::extractImpl(ref <const part> p, utility::outputStream& os,
// header + body
if ((extractFlags & EXTRACT_HEADER) && (extractFlags & EXTRACT_BODY))
- *((int *) 0)=42;//throw exceptions::operation_not_supported();
+ throw exceptions::operation_not_supported();
// body only
else if (extractFlags & EXTRACT_BODY)
command << ".TEXT";
@@ -745,3 +751,6 @@ ref <vmime::message> IMAPMessage::getParsedMessage()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp
index c2cd6479..1f16c698 100644
--- a/src/net/imap/IMAPMessagePartContentHandler.cpp
+++ b/src/net/imap/IMAPMessagePartContentHandler.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPMessagePartContentHandler.hpp"
#include "vmime/utility/outputStreamAdapter.hpp"
@@ -186,3 +192,6 @@ bool IMAPMessagePartContentHandler::isBuffered() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPPart.cpp b/src/net/imap/IMAPPart.cpp
index 32021e83..13de4d77 100644
--- a/src/net/imap/IMAPPart.cpp
+++ b/src/net/imap/IMAPPart.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPPart.hpp"
#include "vmime/net/imap/IMAPStructure.hpp"
@@ -150,3 +156,6 @@ header& IMAPPart::getOrCreateHeader()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPSStore.cpp b/src/net/imap/IMAPSStore.cpp
index 9e92f92c..74f3fe18 100644
--- a/src/net/imap/IMAPSStore.cpp
+++ b/src/net/imap/IMAPSStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPSStore.hpp"
@@ -67,3 +73,7 @@ const serviceInfos& IMAPSStore::getInfos() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPServiceInfos.cpp b/src/net/imap/IMAPServiceInfos.cpp
index 33898f43..9cbb930e 100644
--- a/src/net/imap/IMAPServiceInfos.cpp
+++ b/src/net/imap/IMAPServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPServiceInfos.hpp"
@@ -126,3 +132,6 @@ const std::vector <serviceInfos::property> IMAPServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPStore.cpp b/src/net/imap/IMAPStore.cpp
index f260e55a..0d2adc16 100644
--- a/src/net/imap/IMAPStore.cpp
+++ b/src/net/imap/IMAPStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPStore.hpp"
#include "vmime/net/imap/IMAPFolder.hpp"
#include "vmime/net/imap/IMAPConnection.hpp"
@@ -237,3 +243,7 @@ const serviceInfos& IMAPStore::getInfos() const
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPStructure.cpp b/src/net/imap/IMAPStructure.cpp
index 357febe3..a0bd98bb 100644
--- a/src/net/imap/IMAPStructure.cpp
+++ b/src/net/imap/IMAPStructure.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPStructure.hpp"
#include "vmime/net/imap/IMAPPart.hpp"
@@ -83,3 +89,6 @@ ref <IMAPStructure> IMAPStructure::emptyStructure()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPTag.cpp b/src/net/imap/IMAPTag.cpp
index abb79249..45606f0a 100644
--- a/src/net/imap/IMAPTag.cpp
+++ b/src/net/imap/IMAPTag.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPTag.hpp"
@@ -101,3 +107,7 @@ void IMAPTag::generate()
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index eceac16b..3f1c704b 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
+
#include "vmime/net/imap/IMAPUtils.hpp"
#include "vmime/net/message.hpp"
#include "vmime/net/folder.hpp"
@@ -785,3 +791,7 @@ const message::uid IMAPUtils::makeGlobalUID(const unsigned int UIDValidity, cons
} // imap
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_IMAP
+
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 721517e8..033951a1 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/format/courierMaildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -531,3 +537,6 @@ bool courierMaildirFormat::supports() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index a21d1061..606f2d08 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/format/kmailMaildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -308,3 +314,6 @@ bool kmailMaildirFormat::supports() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index b606cda0..cbea38ee 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFolder.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -1387,3 +1393,7 @@ std::vector <int> maildirFolder::getMessageNumbersStartingOnUID(const message::u
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirFormat.cpp b/src/net/maildir/maildirFormat.cpp
index 78445428..d7cddb5e 100644
--- a/src/net/maildir/maildirFormat.cpp
+++ b/src/net/maildir/maildirFormat.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirFormat.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -98,3 +104,6 @@ ref <maildirFormat> maildirFormat::detect(ref <maildirStore> store)
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index 4ab75e75..dd38cbd8 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirMessage.hpp"
#include "vmime/net/maildir/maildirFolder.hpp"
#include "vmime/net/maildir/maildirUtils.hpp"
@@ -543,3 +549,7 @@ ref <vmime::message> maildirMessage::getParsedMessage()
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirServiceInfos.cpp b/src/net/maildir/maildirServiceInfos.cpp
index 55ba64ea..3c79e417 100644
--- a/src/net/maildir/maildirServiceInfos.cpp
+++ b/src/net/maildir/maildirServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirServiceInfos.hpp"
@@ -66,3 +72,6 @@ const std::vector <serviceInfos::property> maildirServiceInfos::getAvailableProp
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirStore.cpp b/src/net/maildir/maildirStore.cpp
index 26f4593a..3e2659f6 100644
--- a/src/net/maildir/maildirStore.cpp
+++ b/src/net/maildir/maildirStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirStore.hpp"
#include "vmime/net/maildir/maildirFolder.hpp"
@@ -260,3 +266,7 @@ const serviceInfos& maildirStore::getInfos() const
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index 3430d1f8..4a9a67e2 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
+
#include "vmime/net/maildir/maildirUtils.hpp"
#include "vmime/net/maildir/maildirStore.hpp"
@@ -142,7 +148,7 @@ const utility::file::path::component maildirUtils::buildFilename
(const utility::file::path::component& id,
const utility::file::path::component& flags)
{
-#if VMIME_BUILTIN_PLATFORM_WINDOWS
+#if VMIME_PLATFORM_IS_WINDOWS
static const char DELIMITER[] = "-";
#else
static const char DELIMITER[] = ":";
@@ -229,3 +235,7 @@ bool maildirUtils::messageIdComparator::operator()
} // maildir
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_MAILDIR
+
diff --git a/src/net/message.cpp b/src/net/message.cpp
index 9a548097..b8624330 100644
--- a/src/net/message.cpp
+++ b/src/net/message.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/message.hpp"
@@ -48,3 +54,7 @@ int part::getPartCount() const
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index 21e7a8b3..f9a4225f 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Folder.hpp"
#include "vmime/net/pop3/POP3Store.hpp"
@@ -864,3 +870,7 @@ std::vector <int> POP3Folder::getMessageNumbersStartingOnUID(const message::uid&
} // pop3
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index 69ef004c..1c3b3408 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Message.hpp"
#include "vmime/net/pop3/POP3Folder.hpp"
#include "vmime/net/pop3/POP3Store.hpp"
@@ -237,3 +243,7 @@ ref <vmime::message> POP3Message::getParsedMessage()
} // pop3
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3SStore.cpp b/src/net/pop3/POP3SStore.cpp
index 59aacb8e..8a21469b 100644
--- a/src/net/pop3/POP3SStore.cpp
+++ b/src/net/pop3/POP3SStore.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3SStore.hpp"
@@ -68,3 +74,6 @@ const serviceInfos& POP3SStore::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3ServiceInfos.cpp b/src/net/pop3/POP3ServiceInfos.cpp
index 77faa5fd..07922eff 100644
--- a/src/net/pop3/POP3ServiceInfos.cpp
+++ b/src/net/pop3/POP3ServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3ServiceInfos.hpp"
@@ -132,3 +138,6 @@ const std::vector <serviceInfos::property> POP3ServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index 793112a7..51181ece 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Store.hpp"
#include "vmime/net/pop3/POP3Folder.hpp"
@@ -1006,3 +1012,6 @@ const serviceInfos& POP3Store::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/pop3/POP3Utils.cpp b/src/net/pop3/POP3Utils.cpp
index de70dfed..f75d338e 100644
--- a/src/net/pop3/POP3Utils.cpp
+++ b/src/net/pop3/POP3Utils.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
+
#include "vmime/net/pop3/POP3Utils.hpp"
#include <sstream>
@@ -72,3 +78,6 @@ void POP3Utils::parseMultiListOrUidlResponse(const string& response, std::map <i
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_POP3
+
diff --git a/src/net/sendmail/sendmailServiceInfos.cpp b/src/net/sendmail/sendmailServiceInfos.cpp
index fb5fb543..102dfe98 100644
--- a/src/net/sendmail/sendmailServiceInfos.cpp
+++ b/src/net/sendmail/sendmailServiceInfos.cpp
@@ -21,10 +21,13 @@
// the GNU General Public License cover the whole combination.
//
-#include "vmime/net/sendmail/sendmailServiceInfos.hpp"
+#include "vmime/config.hpp"
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
-#if VMIME_BUILTIN_PLATFORM_POSIX
+
+#include "vmime/net/sendmail/sendmailServiceInfos.hpp"
namespace vmime {
@@ -71,5 +74,5 @@ const std::vector <serviceInfos::property> sendmailServiceInfos::getAvailablePro
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
diff --git a/src/net/sendmail/sendmailTransport.cpp b/src/net/sendmail/sendmailTransport.cpp
index e7762ccc..e52e16d5 100644
--- a/src/net/sendmail/sendmailTransport.cpp
+++ b/src/net/sendmail/sendmailTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
+
#include "vmime/net/sendmail/sendmailTransport.hpp"
#include "vmime/exception.hpp"
@@ -48,9 +54,6 @@
dynamic_cast <const sendmailServiceInfos&>(getInfos()).getProperties().prop))
-#if VMIME_BUILTIN_PLATFORM_POSIX
-
-
namespace vmime {
namespace net {
namespace sendmail {
@@ -219,4 +222,5 @@ const serviceInfos& sendmailTransport::getInfos() const
} // vmime
-#endif // VMIME_BUILTIN_PLATFORM_POSIX
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SENDMAIL
+
diff --git a/src/net/service.cpp b/src/net/service.cpp
index f12c78f0..64c243c5 100644
--- a/src/net/service.cpp
+++ b/src/net/service.cpp
@@ -22,6 +22,11 @@
//
#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/service.hpp"
#include "vmime/platform.hpp"
@@ -141,3 +146,7 @@ ref <timeoutHandlerFactory> service::getTimeoutHandlerFactory()
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/serviceFactory.cpp b/src/net/serviceFactory.cpp
index 65f9aa1d..71b7efea 100644
--- a/src/net/serviceFactory.cpp
+++ b/src/net/serviceFactory.cpp
@@ -21,11 +21,16 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/serviceFactory.hpp"
#include "vmime/net/service.hpp"
#include "vmime/exception.hpp"
-#include "vmime/config.hpp"
#include "src/net/builtinServices.inl"
@@ -134,3 +139,7 @@ void serviceFactory::registerService(ref <registeredService> reg)
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/serviceInfos.cpp b/src/net/serviceInfos.cpp
index 069d9e10..ab3a39bd 100644
--- a/src/net/serviceInfos.cpp
+++ b/src/net/serviceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/serviceInfos.hpp"
@@ -156,3 +162,6 @@ int serviceInfos::property::getFlags() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/session.cpp b/src/net/session.cpp
index 3898a8da..308b2989 100644
--- a/src/net/session.cpp
+++ b/src/net/session.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/session.hpp"
#include "vmime/net/serviceFactory.hpp"
@@ -132,3 +138,7 @@ propertySet& session::getProperties()
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/net/smtp/SMTPResponse.cpp b/src/net/smtp/SMTPResponse.cpp
index 03c199ba..e1ac2af6 100644
--- a/src/net/smtp/SMTPResponse.cpp
+++ b/src/net/smtp/SMTPResponse.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPResponse.hpp"
#include "vmime/platform.hpp"
@@ -249,3 +255,6 @@ const string SMTPResponse::responseLine::getText() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPSTransport.cpp b/src/net/smtp/SMTPSTransport.cpp
index db7fc6ff..73d511f9 100644
--- a/src/net/smtp/SMTPSTransport.cpp
+++ b/src/net/smtp/SMTPSTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPSTransport.hpp"
@@ -68,3 +74,6 @@ const serviceInfos& SMTPSTransport::getInfos() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPServiceInfos.cpp b/src/net/smtp/SMTPServiceInfos.cpp
index d2d0dcc2..5fe8dae2 100644
--- a/src/net/smtp/SMTPServiceInfos.cpp
+++ b/src/net/smtp/SMTPServiceInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPServiceInfos.hpp"
@@ -129,3 +135,6 @@ const std::vector <serviceInfos::property> SMTPServiceInfos::getAvailablePropert
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index bbbea755..64028d1c 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
+
#include "vmime/net/smtp/SMTPTransport.hpp"
#include "vmime/net/smtp/SMTPResponse.hpp"
@@ -654,3 +660,7 @@ const serviceInfos& SMTPTransport::getInfos() const
} // smtp
} // net
} // vmime
+
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_MESSAGING_PROTO_SMTP
+
diff --git a/src/net/tls/TLSSecuredConnectionInfos.cpp b/src/net/tls/TLSSecuredConnectionInfos.cpp
index 2a37069a..2d98f913 100644
--- a/src/net/tls/TLSSecuredConnectionInfos.cpp
+++ b/src/net/tls/TLSSecuredConnectionInfos.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
+
#include "vmime/net/tls/TLSSecuredConnectionInfos.hpp"
#include "vmime/net/tls/TLSSession.hpp"
@@ -61,3 +67,6 @@ ref <const security::cert::certificateChain> TLSSecuredConnectionInfos::getPeerC
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT
+
diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp
index 06068085..31149396 100644
--- a/src/net/tls/TLSSession.cpp
+++ b/src/net/tls/TLSSession.cpp
@@ -21,12 +21,17 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include <gnutls/gnutls.h>
#if GNUTLS_VERSION_NUMBER < 0x030000
#include <gnutls/extra.h>
#endif
-#include "vmime/config.hpp"
// Dependency on gcrypt is not needed since GNU TLS version 2.12.
// See here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638651
@@ -138,7 +143,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
// Sets some default priority on the ciphers, key exchange methods,
// macs and compression methods.
-#if HAVE_GNUTLS_PRIORITY_FUNCS
+#if VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
gnutls_dh_set_prime_bits(*m_gnutlsSession, 128);
if ((res = gnutls_priority_set_direct
@@ -152,7 +157,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
}
}
-#else // !HAVE_GNUTLS_PRIORITY_FUNCS
+#else // !VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
gnutls_set_default_priority(*m_gnutlsSession);
@@ -228,7 +233,7 @@ TLSSession::TLSSession(ref <security::cert::certificateVerifier> cv)
gnutls_compression_set_priority(*m_gnutlsSession, compressionPriority);
-#endif // !HAVE_GNUTLS_PRIORITY_FUNCS
+#endif // !VMIME_HAVE_GNUTLS_PRIORITY_FUNCS
// Initialize credentials
gnutls_credentials_set(*m_gnutlsSession,
@@ -288,3 +293,6 @@ void TLSSession::throwTLSException(const string& fname, const int code)
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index 3cccc1e9..6fa8d02d 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
+
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
@@ -406,3 +412,6 @@ void TLSSocket::internalThrow()
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_TLS_SUPPORT && VMIME_TLS_SUPPORT_LIB_IS_GNUTLS
+
diff --git a/src/net/transport.cpp b/src/net/transport.cpp
index f8ca7b7a..9349e750 100644
--- a/src/net/transport.cpp
+++ b/src/net/transport.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/net/transport.hpp"
#include "vmime/utility/stream.hpp"
@@ -135,3 +141,6 @@ transport::Type transport::getType() const
} // net
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/platform.cpp b/src/platform.cpp
index d1d23de0..ff6a9965 100644
--- a/src/platform.cpp
+++ b/src/platform.cpp
@@ -22,6 +22,10 @@
//
#include "vmime/platform.hpp"
+#include "vmime/config.hpp"
+
+#include "vmime/platforms/posix/posixHandler.hpp"
+#include "vmime/platforms/windows/windowsHandler.hpp"
namespace vmime
@@ -36,4 +40,40 @@ platform::handler::~handler()
}
+// static
+ref <platform::handler> platform::getDefaultHandler()
+{
+
+#if VMIME_PLATFORM_IS_WINDOWS
+ return vmime::create <platforms::windows::windowsHandler>();
+#elif VMIME_PLATFORM_IS_POSIX
+ return vmime::create <platforms::posix::posixHandler>();
+#else
+ return NULL;
+#endif
+
+}
+
+
+// static
+ref <platform::handler> platform::getHandler()
+{
+ // If a custom platform handler is installed, return it
+ if (sm_handler)
+ return sm_handler;
+
+ // Else, use the default handler for this platform
+ ref <handler> defaultHandler = getDefaultHandler();
+
+ if (defaultHandler)
+ {
+ sm_handler = defaultHandler;
+ return sm_handler;
+ }
+
+ // Oops... no platform handler!
+ throw exceptions::no_platform_handler();
+}
+
+
} // vmime
diff --git a/src/platforms/posix/posixChildProcess.cpp b/src/platforms/posix/posixChildProcess.cpp
index 68ef021e..a05942da 100644
--- a/src/platforms/posix/posixChildProcess.cpp
+++ b/src/platforms/posix/posixChildProcess.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/posix/posixChildProcess.hpp"
#include "vmime/platforms/posix/posixFile.hpp"
@@ -394,3 +400,6 @@ void posixChildProcess::waitForFinish()
} // platforms
} // vmime
+
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 4087a21f..2f67a2be 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/posix/posixFile.hpp"
#include <unistd.h>
@@ -38,9 +44,6 @@
#include "vmime/exception.hpp"
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace posix {
@@ -621,4 +624,4 @@ void posixFileSystemFactory::reportError(const vmime::utility::path& path, const
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_FILESYSTEM_FEATURES
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index 2c113072..8629b1e2 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX
+
+
#include "vmime/platforms/posix/posixHandler.hpp"
#include <time.h>
@@ -258,3 +264,6 @@ void posixHandler::wait() const
} // posix
} // platforms
} // vmime
+
+
+#endif // VMIME_PLATFORM_IS_POSIX
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index f280dadc..6fcbd118 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/platforms/posix/posixSocket.hpp"
#include "vmime/platforms/posix/posixHandler.hpp"
@@ -37,9 +43,6 @@
#include "vmime/exception.hpp"
-#if VMIME_HAVE_MESSAGING_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace posix {
@@ -493,4 +496,4 @@ ref <vmime::net::socket> posixSocketFactory::create(ref <vmime::net::timeoutHand
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_POSIX && VMIME_HAVE_MESSAGING_FEATURES
diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 5da786e5..7a70d364 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
+
+
#include "vmime/platforms/windows/windowsFile.hpp"
#include <windows.h>
@@ -30,9 +36,6 @@
#include "vmime/utility/stringUtils.hpp"
-#if VMIME_HAVE_FILESYSTEM_FEATURES
-
-
namespace vmime {
namespace platforms {
namespace windows {
@@ -546,4 +549,5 @@ void windowsFileWriterOutputStream::flush()
} // vmime
-#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_FILESYSTEM_FEATURES
+
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 1a37c839..1ed4025b 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -21,9 +21,14 @@
// the GNU General Public License cover the whole combination.
//
-#include "vmime/platforms/windows/windowsHandler.hpp"
#include "vmime/config.hpp"
+
+#if VMIME_PLATFORM_IS_WINDOWS
+
+
+#include "vmime/platforms/windows/windowsHandler.hpp"
+
#include <time.h>
#include <locale.h>
#include <process.h>
@@ -270,3 +275,7 @@ void windowsHandler::wait() const
} // posix
} // platforms
} // vmime
+
+
+#endif // VMIME_PLATFORM_IS_WINDOWS
+
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index 430c8ea0..27cbcaa7 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -21,13 +21,18 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
+
+
#pragma warning(disable: 4267)
#include "vmime/platforms/windows/windowsSocket.hpp"
#include "vmime/exception.hpp"
-#if VMIME_HAVE_MESSAGING_FEATURES
namespace vmime {
namespace platforms {
@@ -193,4 +198,5 @@ ref <vmime::net::socket> windowsSocketFactory::create(ref <vmime::net::timeoutHa
} // vmime
-#endif // VMIME_HAVE_MESSAGING_FEATURES
+#endif // VMIME_PLATFORM_IS_WINDOWS && VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/security/defaultAuthenticator.cpp b/src/security/defaultAuthenticator.cpp
index 088ef0da..fdd19303 100644
--- a/src/security/defaultAuthenticator.cpp
+++ b/src/security/defaultAuthenticator.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES
+
+
#include "vmime/security/defaultAuthenticator.hpp"
#include "vmime/net/service.hpp"
@@ -104,3 +110,6 @@ weak_ref <net::service> defaultAuthenticator::getService() const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES
+
diff --git a/src/security/sasl/SASLContext.cpp b/src/security/sasl/SASLContext.cpp
index 4bb33c14..8c623124 100644
--- a/src/security/sasl/SASLContext.cpp
+++ b/src/security/sasl/SASLContext.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <sstream>
#include <gsasl.h>
@@ -197,3 +203,6 @@ const string SASLContext::getErrorMessage(const string& fname, const int code)
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLMechanismFactory.cpp b/src/security/sasl/SASLMechanismFactory.cpp
index 285d6d36..00632fb8 100644
--- a/src/security/sasl/SASLMechanismFactory.cpp
+++ b/src/security/sasl/SASLMechanismFactory.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <stdexcept>
#include <new>
@@ -133,3 +139,6 @@ bool SASLMechanismFactory::isMechanismSupported(const string& name) const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLSession.cpp b/src/security/sasl/SASLSession.cpp
index c1688b78..dcf53452 100644
--- a/src/security/sasl/SASLSession.cpp
+++ b/src/security/sasl/SASLSession.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <sstream>
#include <gsasl.h>
@@ -181,3 +187,6 @@ int SASLSession::gsaslCallback
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp
index d88153e4..28f5f6f6 100644
--- a/src/security/sasl/SASLSocket.cpp
+++ b/src/security/sasl/SASLSocket.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/SASLSocket.hpp"
#include "vmime/security/sasl/SASLSession.hpp"
@@ -175,3 +181,6 @@ void SASLSocket::sendRaw(const char* buffer, const size_type count)
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/builtinSASLMechanism.cpp b/src/security/sasl/builtinSASLMechanism.cpp
index 767caf96..9501fb4b 100644
--- a/src/security/sasl/builtinSASLMechanism.cpp
+++ b/src/security/sasl/builtinSASLMechanism.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include <gsasl.h>
#include "vmime/security/sasl/builtinSASLMechanism.hpp"
@@ -184,3 +190,6 @@ void builtinSASLMechanism::decode
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/security/sasl/defaultSASLAuthenticator.cpp b/src/security/sasl/defaultSASLAuthenticator.cpp
index 4eae4e39..eba703b2 100644
--- a/src/security/sasl/defaultSASLAuthenticator.cpp
+++ b/src/security/sasl/defaultSASLAuthenticator.cpp
@@ -21,6 +21,12 @@
// the GNU General Public License cover the whole combination.
//
+#include "vmime/config.hpp"
+
+
+#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
+
#include "vmime/security/sasl/defaultSASLAuthenticator.hpp"
#include "vmime/security/sasl/SASLMechanism.hpp"
@@ -141,3 +147,6 @@ ref <SASLMechanism> defaultSASLAuthenticator::getSASLMechanism() const
} // security
} // vmime
+
+#endif // VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
+
diff --git a/src/utility/encoder/uuEncoder.cpp b/src/utility/encoder/uuEncoder.cpp
index d2974e63..0ddfbac6 100644
--- a/src/utility/encoder/uuEncoder.cpp
+++ b/src/utility/encoder/uuEncoder.cpp
@@ -116,8 +116,8 @@ utility::stream::size_type uuEncoder::encode(utility::inputStream& in,
const unsigned char c3 = static_cast <unsigned char>(inBuffer[i + 2]);
outBuffer[j] = UUENCODE(c1 >> 2);
- outBuffer[j + 1] = UUENCODE((c1 << 4) & 060 | (c2 >> 4) & 017);
- outBuffer[j + 2] = UUENCODE((c2 << 2) & 074 | (c3 >> 6) & 03);
+ outBuffer[j + 1] = UUENCODE(((c1 << 4) & 060) | ((c2 >> 4) & 017));
+ outBuffer[j + 2] = UUENCODE(((c2 << 2) & 074) | ((c3 >> 6) & 03));
outBuffer[j + 3] = UUENCODE(c3 & 077);
}
@@ -173,7 +173,7 @@ utility::stream::size_type uuEncoder::decode(utility::inputStream& in,
const utility::stream::size_type outLength = UUDECODE(lengthChar);
const utility::stream::size_type inLength =
std::min((outLength * 4) / 3, static_cast <utility::stream::size_type>(64));
- utility::stream::value_type inPos = 0;
+ utility::stream::size_type inPos = 0;
switch (lengthChar)
{
@@ -302,9 +302,9 @@ utility::stream::size_type uuEncoder::decode(utility::inputStream& in,
switch (n)
{
default:
- case 3: outBuffer[j + 2] = UUDECODE(c3) << 6 | UUDECODE(c4);
- case 2: outBuffer[j + 1] = UUDECODE(c2) << 4 | UUDECODE(c3) >> 2;
- case 1: outBuffer[j] = UUDECODE(c1) << 2 | UUDECODE(c2) >> 4;
+ case 3: outBuffer[j + 2] = static_cast <unsigned char>(UUDECODE(c3) << 6 | UUDECODE(c4));
+ case 2: outBuffer[j + 1] = static_cast <unsigned char>(UUDECODE(c2) << 4 | UUDECODE(c3) >> 2);
+ case 1: outBuffer[j] = static_cast <unsigned char>(UUDECODE(c1) << 2 | UUDECODE(c2) >> 4);
case 0: break;
}