summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Pavlov <alexpux@gmail.com>2012-09-15 20:38:10 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-09-15 20:38:10 +0200
commit365808837080574080b4f8da079124c172fb2123 (patch)
tree432d773c84d863da712f4f2bc857ea125e1c7716
parent3ce4d213480471dfd8e307c24c99bf3c6308cd6f (diff)
Fix build using mingw64 with winpthread
strtok_r in winpthread is declared as a macro, that is why the error happens. Therefore, it is necessary to check whether the macro __WINPTHREADS_VERSION is declared. Bug #54851
-rw-r--r--poppler/poppler-config.h.cmake2
-rw-r--r--poppler/poppler-config.h.in2
-rw-r--r--poppler/strtok_r.cpp16
3 files changed, 17 insertions, 3 deletions
diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake
index 94a12aad..382ca450 100644
--- a/poppler/poppler-config.h.cmake
+++ b/poppler/poppler-config.h.cmake
@@ -158,7 +158,7 @@
#if defined(_WIN32)
#ifdef _MSC_VER
#define strtok_r strtok_s
-#elif __MINGW32__
+#elif __MINGW32__ && !defined(__WINPTHREADS_VERSION)
char * strtok_r (char *s, const char *delim, char **save_ptr);
#endif
#endif
diff --git a/poppler/poppler-config.h.in b/poppler/poppler-config.h.in
index 302d12ee..0d8b379b 100644
--- a/poppler/poppler-config.h.in
+++ b/poppler/poppler-config.h.in
@@ -158,7 +158,7 @@
#if defined(_WIN32)
#ifdef _MSC_VER
#define strtok_r strtok_s
-#elif __MINGW32__
+#elif __MINGW32__ && !defined(__WINPTHREADS_VERSION)
char * strtok_r (char *s, const char *delim, char **save_ptr);
#endif
#endif
diff --git a/poppler/strtok_r.cpp b/poppler/strtok_r.cpp
index 30e2196a..dc35e006 100644
--- a/poppler/strtok_r.cpp
+++ b/poppler/strtok_r.cpp
@@ -40,7 +40,21 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifdef __MINGW32__
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2012 Alexey Pavlov <alexpux@gmail.com>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifdef __MINGW32__ && !defined(__WINPTHREADS_VERSION)
#include <string.h>
#define __rawmemchr strchr