Merge pull request #36 from Biswa96/check-debug-mode-assert
Fix building in MinGW
diff --git a/src/xalanc/Harness/XalanFileUtility.cpp b/src/xalanc/Harness/XalanFileUtility.cpp
index 91f87dd..b0b166d 100644
--- a/src/xalanc/Harness/XalanFileUtility.cpp
+++ b/src/xalanc/Harness/XalanFileUtility.cpp
@@ -2115,7 +2115,7 @@
if (result == 0)
{
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
CharVectorType theBuffer(getMemoryManager());
TranscodeToLocalCodePage(theHTMLFile, theBuffer, true);
diff --git a/src/xalanc/Include/PlatformDefinitions.hpp.in b/src/xalanc/Include/PlatformDefinitions.hpp.in
index 74cc5e6..e460bf2 100644
--- a/src/xalanc/Include/PlatformDefinitions.hpp.in
+++ b/src/xalanc/Include/PlatformDefinitions.hpp.in
@@ -53,7 +53,7 @@
// These defines provide the platform specific keywords that they need
// to do this.
// ---------------------------------------------------------------------------
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
#define XALAN_PLATFORM_EXPORT __declspec(dllexport)
#define XALAN_PLATFORM_IMPORT __declspec(dllimport)
#define XALAN_PLATFORM_EXPORT_FUNCTION(T) XALAN_PLATFORM_EXPORT T
diff --git a/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp b/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp
index 2384c70..ffd5e27 100644
--- a/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp
+++ b/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp
@@ -26,7 +26,7 @@
#include <cstring>
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
#include <io.h>
#else
#include <dirent.h>
@@ -59,7 +59,7 @@
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
struct FindFileStruct : public _wfinddata_t
{
@@ -240,7 +240,7 @@
bool fIncludeSelfAndParent = false)
#endif
{
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
FindFileStruct theFindData;
#ifdef _WIN64
@@ -249,13 +249,17 @@
typedef long theHandleType;
#endif
+#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4244)
+#endif
theHandleType theSearchHandle =
_wfindfirst(
reinterpret_cast<wchar_t*>(const_cast<XalanDOMChar*>(theConversionFunction(theFullSearchSpec))),
&theFindData);
+#if defined(_MSC_VER)
#pragma warning(pop)
+#endif
if (theSearchHandle != -1)
{
diff --git a/src/xalanc/PlatformSupport/DoubleSupport.hpp b/src/xalanc/PlatformSupport/DoubleSupport.hpp
index a142354..e13393b 100644
--- a/src/xalanc/PlatformSupport/DoubleSupport.hpp
+++ b/src/xalanc/PlatformSupport/DoubleSupport.hpp
@@ -25,7 +25,7 @@
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
#include <float.h>
#endif
#include <cmath>
diff --git a/src/xalanc/PlatformSupport/XalanFileOutputStream.hpp b/src/xalanc/PlatformSupport/XalanFileOutputStream.hpp
index 27ab4d7..3376fa3 100644
--- a/src/xalanc/PlatformSupport/XalanFileOutputStream.hpp
+++ b/src/xalanc/PlatformSupport/XalanFileOutputStream.hpp
@@ -40,8 +40,9 @@
namespace XALAN_CPP_NAMESPACE {
-
+#if !defined(XALAN_WINDOWS)
using std::FILE;
+#endif
class XALAN_PLATFORMSUPPORT_EXPORT XalanFileOutputStream : public XalanOutputStream
{
diff --git a/src/xalanc/XPathCAPI/XPathCAPI.h b/src/xalanc/XPathCAPI/XPathCAPI.h
index b754c00..af95148 100644
--- a/src/xalanc/XPathCAPI/XPathCAPI.h
+++ b/src/xalanc/XPathCAPI/XPathCAPI.h
@@ -20,7 +20,7 @@
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
#if defined(XALAN_BUILD_DLL)
diff --git a/src/xalanc/XalanExe/XalanExe.cpp b/src/xalanc/XalanExe/XalanExe.cpp
index ad96a06..00f1c04 100644
--- a/src/xalanc/XalanExe/XalanExe.cpp
+++ b/src/xalanc/XalanExe/XalanExe.cpp
@@ -44,7 +44,7 @@
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
#define XALAN_USE_WINDOWS_TIMING
#endif