From 400cb033c0a0f336b9f8c3a86004bb3aaaaa76ad Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Mon, 8 Jul 2019 13:34:16 +0200
Subject: [PATCH] COMP: erroneous double definition for long IO on windows
 (#1360, #1238)

- mingw uses 32-bit long regardless of -m32 or -m64 setting
---
 src/OpenFOAM/primitives/ints/int64/int64.H   | 4 ++--
 src/OpenFOAM/primitives/ints/int64/int64IO.C | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/OpenFOAM/primitives/ints/int64/int64.H b/src/OpenFOAM/primitives/ints/int64/int64.H
index 095aa0aa213..9b666528b2a 100644
--- a/src/OpenFOAM/primitives/ints/int64/int64.H
+++ b/src/OpenFOAM/primitives/ints/int64/int64.H
@@ -119,10 +119,10 @@ inline bool read(const std::string& str, int64_t& val)
 Istream& operator>>(Istream& is, int64_t& val);
 Ostream& operator<<(Ostream& os, const int64_t val);
 
-// On Darwin and Windows (mingw):
+// On Darwin:
 // long is not unambiguously (int32_t | int64_t)
 // - explicitly resolve for input and output
-#if defined(__APPLE__) || defined(_WIN32)
+#if defined(__APPLE__)
     Istream& operator>>(Istream& is, long& val);
     Ostream& operator<<(Ostream& os, const long val);
 #endif
diff --git a/src/OpenFOAM/primitives/ints/int64/int64IO.C b/src/OpenFOAM/primitives/ints/int64/int64IO.C
index add4abb4552..4e084aff8a0 100644
--- a/src/OpenFOAM/primitives/ints/int64/int64IO.C
+++ b/src/OpenFOAM/primitives/ints/int64/int64IO.C
@@ -125,7 +125,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const int64_t val)
 }
 
 
-#if defined(__APPLE__) || defined(_WIN32)
+#if defined(__APPLE__)
 Foam::Istream& Foam::operator>>(Istream& is, long& val)
 {
     return operator>>(is, reinterpret_cast<int64_t&>(val));
-- 
GitLab