From a4f4235139635bb375152950e6d852b4bbb38868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCtzel?= Date: Mon, 1 Sep 2014 09:59:57 +0200 Subject: [PATCH] added necessary QT_DECL_EXPORT/QT_DECL_IMPORT to be able to build a DLL on windows --- SMTPEmail.pro | 10 ++++++++-- src/emailaddress.h | 4 +++- src/mimeattachment.h | 4 +++- src/mimecontentformatter.h | 4 +++- src/mimefile.h | 4 +++- src/mimehtml.h | 4 +++- src/mimeinlinefile.h | 4 +++- src/mimemessage.h | 4 +++- src/mimemultipart.h | 4 +++- src/mimepart.h | 4 +++- src/mimetext.h | 4 +++- src/quotedprintable.h | 4 +++- src/smtpclient.h | 4 ++-- src/smtpexports.h | 10 ++++++++++ 14 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 src/smtpexports.h diff --git a/SMTPEmail.pro b/SMTPEmail.pro index 2fc74d6..3b8c302 100644 --- a/SMTPEmail.pro +++ b/SMTPEmail.pro @@ -7,8 +7,13 @@ QT += core gui network TARGET = SMTPEmail -TEMPLATE = app +TEMPLATE = app +# uncomment this to build a shared library +#TEMPLATE = lib +#CONFIG += dll + +DEFINES += SMTP_BUILD SOURCES += \ src/emailaddress.cpp \ @@ -37,7 +42,8 @@ HEADERS += \ src/SmtpMime \ src/quotedprintable.h \ src/mimemultipart.h \ - src/mimecontentformatter.h + src/mimecontentformatter.h \ + src/smtpexports.h OTHER_FILES += \ LICENSE \ diff --git a/src/emailaddress.h b/src/emailaddress.h index 957ba2b..4ecf6ef 100644 --- a/src/emailaddress.h +++ b/src/emailaddress.h @@ -21,7 +21,9 @@ #include -class EmailAddress : public QObject +#include "smtpexports.h" + +class SMTP_EXPORT EmailAddress : public QObject { Q_OBJECT public: diff --git a/src/mimeattachment.h b/src/mimeattachment.h index 4f9efa0..4a92e9a 100644 --- a/src/mimeattachment.h +++ b/src/mimeattachment.h @@ -23,7 +23,9 @@ #include "mimepart.h" #include "mimefile.h" -class MimeAttachment : public MimeFile +#include "smtpexports.h" + +class SMTP_EXPORT MimeAttachment : public MimeFile { Q_OBJECT public: diff --git a/src/mimecontentformatter.h b/src/mimecontentformatter.h index 8180cb6..bf75158 100644 --- a/src/mimecontentformatter.h +++ b/src/mimecontentformatter.h @@ -22,7 +22,9 @@ #include #include -class MimeContentFormatter : public QObject +#include "smtpexports.h" + +class SMTP_EXPORT MimeContentFormatter : public QObject { Q_OBJECT public: diff --git a/src/mimefile.h b/src/mimefile.h index 9e1b46f..13f444d 100644 --- a/src/mimefile.h +++ b/src/mimefile.h @@ -22,7 +22,9 @@ #include "mimepart.h" #include -class MimeFile : public MimePart +#include "smtpexports.h" + +class SMTP_EXPORT MimeFile : public MimePart { Q_OBJECT public: diff --git a/src/mimehtml.h b/src/mimehtml.h index 037c05f..f3f5430 100644 --- a/src/mimehtml.h +++ b/src/mimehtml.h @@ -21,7 +21,9 @@ #include "mimetext.h" -class MimeHtml : public MimeText +#include "smtpexports.h" + +class SMTP_EXPORT MimeHtml : public MimeText { Q_OBJECT public: diff --git a/src/mimeinlinefile.h b/src/mimeinlinefile.h index 6a7444e..98fe3ca 100644 --- a/src/mimeinlinefile.h +++ b/src/mimeinlinefile.h @@ -21,7 +21,9 @@ #include "mimefile.h" -class MimeInlineFile : public MimeFile +#include "smtpexports.h" + +class SMTP_EXPORT MimeInlineFile : public MimeFile { public: diff --git a/src/mimemessage.h b/src/mimemessage.h index b524f74..18b4ec3 100644 --- a/src/mimemessage.h +++ b/src/mimemessage.h @@ -24,7 +24,9 @@ #include "emailaddress.h" #include -class MimeMessage : public QObject +#include "smtpexports.h" + +class SMTP_EXPORT MimeMessage : public QObject { public: diff --git a/src/mimemultipart.h b/src/mimemultipart.h index 8a85b6f..a8e9f59 100644 --- a/src/mimemultipart.h +++ b/src/mimemultipart.h @@ -21,7 +21,9 @@ #include "mimepart.h" -class MimeMultiPart : public MimePart +#include "smtpexports.h" + +class SMTP_EXPORT MimeMultiPart : public MimePart { Q_OBJECT public: diff --git a/src/mimepart.h b/src/mimepart.h index 3eda975..8636035 100644 --- a/src/mimepart.h +++ b/src/mimepart.h @@ -22,7 +22,9 @@ #include #include "mimecontentformatter.h" -class MimePart : public QObject +#include "smtpexports.h" + +class SMTP_EXPORT MimePart : public QObject { Q_OBJECT public: diff --git a/src/mimetext.h b/src/mimetext.h index 124ad5b..c0d2983 100644 --- a/src/mimetext.h +++ b/src/mimetext.h @@ -21,7 +21,9 @@ #include "mimepart.h" -class MimeText : public MimePart +#include "smtpexports.h" + +class SMTP_EXPORT MimeText : public MimePart { public: diff --git a/src/quotedprintable.h b/src/quotedprintable.h index 9c74946..020b7d2 100644 --- a/src/quotedprintable.h +++ b/src/quotedprintable.h @@ -22,7 +22,9 @@ #include #include -class QuotedPrintable : public QObject +#include "smtpexports.h" + +class SMTP_EXPORT QuotedPrintable : public QObject { Q_OBJECT public: diff --git a/src/smtpclient.h b/src/smtpclient.h index 5e3372c..2234d9a 100644 --- a/src/smtpclient.h +++ b/src/smtpclient.h @@ -23,9 +23,9 @@ #include #include "mimemessage.h" +#include "smtpexports.h" - -class SmtpClient : public QObject +class SMTP_EXPORT SmtpClient : public QObject { Q_OBJECT public: diff --git a/src/smtpexports.h b/src/smtpexports.h new file mode 100644 index 0000000..0c4919f --- /dev/null +++ b/src/smtpexports.h @@ -0,0 +1,10 @@ +#ifndef SMTPEXPORTS_H +#define SMTPEXPORTS_H + +#ifdef SMTP_BUILD +#define SMTP_EXPORT Q_DECL_EXPORT +#else +#define SMTP_EXPORT Q_DECL_IMPORT +#endif + +#endif // SMTPEXPORTS_H