MinGW compilation fix

This commit is contained in:
Jakub Melka 2021-12-18 17:00:04 +01:00
parent f814a85df8
commit c75b8d677c
9 changed files with 41 additions and 5 deletions

View File

@ -34,8 +34,10 @@
#define NOMINMAX
#include <Windows.h>
#include <Icm.h>
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "Mscms")
#endif
#endif
#include <unordered_map>

View File

@ -34,15 +34,18 @@
#include <QPainterPath>
#include <QDataStream>
#include <QTreeWidgetItem>
#if defined(Q_OS_WIN)
#include "Windows.h"
#pragma comment(lib, "Gdi32")
#pragma comment(lib, "User32")
#elif defined(Q_OS_UNIX)
#include <fontconfig/fontconfig.h>
#endif
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "Gdi32")
#pragma comment(lib, "User32")
#endif
namespace pdf
{
/// Storage class for system fonts

View File

@ -15,7 +15,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFGLOBAL_H
#define PDFGLOBAL_H
@ -32,6 +31,27 @@
# define PDF4QTLIBSHARED_EXPORT Q_DECL_IMPORT
#endif
// Compiler detection
#if defined(_MSC_VER)
#define PDF4QT_COMPILER_MSVC 1
#endif
#if defined(__clang__)
#define PDF4QT_COMPILER_CLANG 1
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
#define PDF4QT_COMPILER_MINGW 1
#endif
#if defined(__GNUC__)
#define PDF4QT_COMPILER_GCC 1
#endif
#if defined(Q_OS_WIN) && (defined(PDF4QT_COMPILER_MSVC) || defined(PDF4QT_COMPILER_CLANG))
#define PDF4QT_USE_PRAGMA_LIB 1
#endif
namespace pdf
{

View File

@ -2009,8 +2009,10 @@ void PDFCertificateStore::createDirectoryForDefaultUserCertificatesStore()
#ifdef Q_OS_WIN
#include <Windows.h>
#include <wincrypt.h>
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "crypt32.lib")
#endif
#endif
void pdf::PDFPublicKeySignatureHandler::addTrustedCertificates(X509_STORE* store) const
{

View File

@ -32,8 +32,10 @@
#define SECURITY_WIN32
#include <Windows.h>
#include <security.h>
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "Secur32.lib")
#endif
#endif
#pragma warning(push)
#pragma warning(disable:5033)

View File

@ -52,7 +52,7 @@
#include <QToolBar>
#include <QXmlStreamWriter>
#ifdef Q_OS_WIN
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "Shell32")
#endif

View File

@ -413,6 +413,9 @@ void PDFTextToSpeech::onPlayClicked()
updatePlay();
break;
}
default:
break;
}
updateUI();

View File

@ -19,8 +19,10 @@
#ifdef Q_OS_WIN
#include <sapi.h>
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "ole32")
#endif
#endif
namespace pdfplugin
{

View File

@ -23,7 +23,9 @@
#include <sapi.h>
#if defined(PDF4QT_USE_PRAGMA_LIB)
#pragma comment(lib, "ole32")
#endif
namespace pdftool
{