diff -ur ./src/base/PdfCompilerCompat.h ../podofo-svn-change/src/base/PdfCompilerCompat.h
--- ./src/base/PdfCompilerCompat.h	2010-10-21 19:09:00.000000000 +0200
+++ ../podofo-svn-change/src/base/PdfCompilerCompat.h	2011-03-11 13:15:27.945685900 +0100
@@ -74,7 +74,7 @@
 #endif
 
 // Disable usage of min() and max() macros 
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__MINGW32__)
 #define NOMINMAX
 #endif
 
diff -ur ./src/base/PdfCompilerCompatPrivate.h ../podofo-svn-change/src/base/PdfCompilerCompatPrivate.h
--- ./src/base/PdfCompilerCompatPrivate.h	2010-10-21 19:09:00.000000000 +0200
+++ ../podofo-svn-change/src/base/PdfCompilerCompatPrivate.h	2011-03-11 13:15:46.102284500 +0100
@@ -46,7 +46,7 @@
 
 #ifdef PODOFO_MULTI_THREAD
 #  if defined(_WIN32) || defined(_WIN64)
-#    if !defined(_WINSOCK2API_)
+#    if defined(_MSC_VER) && !defined(_WINSOCK2API_)
 #      error <winsock2.h> must be included before <windows.h>, config problem?
 #    endif
 #    ifndef _WIN32_WINNT
@@ -126,7 +126,7 @@
  */
 
 inline static pdf_uint32 podofo_ntohl(pdf_uint32 i) {
-#ifdef _WIN32
+#if defined(_WIN32) && defined(_MSC_VER)
    return (pdf_uint32)( ntohl( i ) );
 #else
    return static_cast<pdf_uint32>( ntohl( i ) );
@@ -134,7 +134,7 @@
 }
 
 inline static pdf_uint16 podofo_ntohs(pdf_uint16 i) {
-#ifdef _WIN32
+#if defined(_WIN32) && defined(_MSC_VER)
    return (pdf_uint16)( ntohs( i ) );
 #else
    return static_cast<pdf_uint16>( ntohs( i ) );
@@ -142,7 +142,7 @@
 }
 
 inline static pdf_uint32 podofo_htonl(pdf_uint32 i) {
-#ifdef _WIN32
+#if defined(_WIN32) && defined(_MSC_VER)
     return (pdf_uint32)( htonl( i ) );
 #else
     return static_cast<pdf_uint32>( htonl( i ) );
@@ -150,7 +150,7 @@
 }
 
 inline static pdf_uint16 podofo_htons(pdf_uint16 i) {
-#ifdef _WIN32
+#if defined(_WIN32) && defined(_MSC_VER)
     return (pdf_uint16)( htons( i ) );
 #else
     return static_cast<pdf_uint16>( htons( i ) );
diff -ur ./src/base/podofoapi.h ../podofo-svn-change/src/base/podofoapi.h
--- ./src/base/podofoapi.h	2011-03-08 20:21:54.000000000 +0100
+++ ../podofo-svn-change/src/base/podofoapi.h	2011-03-11 13:16:47.228458100 +0100
@@ -159,7 +159,7 @@
 
 // Peter Petrov 27 April 2008
 // Disable warnings
-#ifdef _WIN32
+#if defined(_WIN32) && defined(_MSC_VER)
 #pragma warning(disable: 4251)
 #pragma warning(disable: 4309)
 #endif // _WIN32
