You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by rl...@apache.org on 2021/11/23 19:59:09 UTC
[xalan-c] branch master updated: Fix building in MinGW
This is an automated email from the ASF dual-hosted git repository.
rleigh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xalan-c.git
The following commit(s) were added to refs/heads/master by this push:
new e4b2e9e Fix building in MinGW
new c326619 Merge pull request #36 from Biswa96/check-debug-mode-assert
e4b2e9e is described below
commit e4b2e9e54ebd75589acdd1af09bc0439d445936f
Author: Biswapriyo Nath <na...@gmail.com>
AuthorDate: Wed May 5 14:59:22 2021 +0530
Fix building in MinGW
Changes:
* Check XALAN_WINDOWS instead of _MSC_VER for Win32 platform.
* Check _MSC_VER for MSVC specific pragma directives.
* Check Win32 platform for std::FILE type.
---
src/xalanc/Harness/XalanFileUtility.cpp | 2 +-
src/xalanc/Include/PlatformDefinitions.hpp.in | 2 +-
src/xalanc/PlatformSupport/DirectoryEnumerator.hpp | 10 +++++++---
src/xalanc/PlatformSupport/DoubleSupport.hpp | 2 +-
src/xalanc/PlatformSupport/XalanFileOutputStream.hpp | 3 ++-
src/xalanc/XPathCAPI/XPathCAPI.h | 2 +-
src/xalanc/XalanExe/XalanExe.cpp | 2 +-
7 files changed, 14 insertions(+), 9 deletions(-)
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 @@ XalanFileUtility::analyzeResults(XalanTransformer& xalan, const XalanDOMString&
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 @@ using xercesc::MemoryManager;
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
struct FindFileStruct : public _wfinddata_t
{
@@ -240,7 +240,7 @@ EnumerateDirectory(
bool fIncludeSelfAndParent = false)
#endif
{
-#if defined(_MSC_VER)
+#if defined(XALAN_WINDOWS)
FindFileStruct theFindData;
#ifdef _WIN64
@@ -249,13 +249,17 @@ EnumerateDirectory(
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
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org