Commit 49107ffc authored by Adrian Johnson's avatar Adrian Johnson

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
parent 4f687665
......@@ -25,6 +25,7 @@
//========================================================================
#include <config.h>
#include <poppler-config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
......
......@@ -82,7 +82,7 @@
#include <fontconfig/fontconfig.h>
#endif
#ifdef _WIN32
#ifdef _MSVC
# define strcasecmp stricmp
#else
# include <strings.h>
......
......@@ -42,6 +42,7 @@
//========================================================================
#include <config.h>
#include <poppler-config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment