summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2017-11-12 10:33:07 +1030
committerAdrian Johnson <ajohnson@redneon.com>2017-11-15 18:15:18 +1030
commit49107ffcd4d3c9b18fc950d37bede08f89bcfcda (patch)
treec9343c884b433b394e71f625a230eba77e79fd24
parent4f687665c39da743e802fc71ba05fb5966095293 (diff)
Fix some mingw warnings
- Include poppler-config.h for mingw PRINTF_FORMAT - Only redefine strcasecmp for MSVC - Recent versions of MSVC have snprintf and vsnprintf
-rw-r--r--poppler/Error.cc1
-rw-r--r--poppler/GlobalParams.cc2
-rw-r--r--poppler/PDFDoc.cc1
-rw-r--r--test/perf-test.cc15
4 files changed, 6 insertions, 13 deletions
diff --git a/poppler/Error.cc b/poppler/Error.cc
index 99ca3ad3..71bd3ce9 100644
--- a/poppler/Error.cc
+++ b/poppler/Error.cc
@@ -25,6 +25,7 @@
//========================================================================
#include <config.h>
+#include <poppler-config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 09ad37a2..8069b3e2 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -82,7 +82,7 @@
#include <fontconfig/fontconfig.h>
#endif
-#ifdef _WIN32
+#ifdef _MSVC
# define strcasecmp stricmp
#else
# include <strings.h>
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index a2468a5f..09ee0a21 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -42,6 +42,7 @@
//========================================================================
#include <config.h>
+#include <poppler-config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
diff --git a/test/perf-test.cc b/test/perf-test.cc
index bd455038..78083275 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -735,15 +735,6 @@ static void StrList_Destroy(StrList **root)
*root = NULL;
}
-#ifndef _WIN32
-/*static void OutputDebugString(const char *txt)
-{
- // do nothing
-}*/
-#define _snprintf snprintf
-#define _vsnprintf vsnprintf
-#endif
-
static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
#if 0
char buf[4096], *p = buf;
@@ -762,7 +753,7 @@ static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
}
p = buf;
- p += _vsnprintf(p, sizeof(buf) - 1, msg, args);
+ p += vsnprintf(p, sizeof(buf) - 1, msg, args);
while ( p > buf && isspace(p[-1]) )
*--p = '\0';
*p++ = '\r';
@@ -785,7 +776,7 @@ static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
#if 0
p = buf;
va_start(args, msg);
- p += _vsnprintf(p, sizeof(buf) - 3, msg, args);
+ p += vsnprintf(p, sizeof(buf) - 3, msg, args);
while ( p > buf && isspace(p[-1]) )
*--p = '\0';
*p++ = '\r';
@@ -807,7 +798,7 @@ static void LogInfo(const char *fmt, ...)
p = buf;
va_start(args, fmt);
- p += _vsnprintf(p, sizeof(buf) - 1, fmt, args);
+ p += vsnprintf(p, sizeof(buf) - 1, fmt, args);
*p = '\0';
fprintf(gOutFile, "%s", buf);
va_end(args);