Skip to content
Snippets Groups Projects
Commit bdb890d4 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

COMP: disambiguate pTraits for long/unsigned long on Darwin

parent 707db0b6
Branches
Tags
No related merge requests found
Test-pTraits.C
Test-pTraits.cxx
EXE = $(FOAM_USER_APPBIN)/Test-pTraits
......@@ -126,7 +126,7 @@ Ostream& operator<<(Ostream& os, const int64_t val);
// On Darwin:
// long is not unambiguously (int32_t | int64_t)
// - explicitly resolve for input and output
#if defined(__APPLE__)
#ifdef __APPLE__
Istream& operator>>(Istream& is, long& val);
Ostream& operator<<(Ostream& os, const long val);
#endif
......@@ -196,6 +196,11 @@ public:
};
#ifdef __APPLE__
//- On Darwin: long is not unambiguously (int64_t)
template<> class pTraits<long> : pTraits<int64_t> {};
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -182,7 +182,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const int64_t val)
}
#if defined(__APPLE__)
#ifdef __APPLE__
Foam::Istream& Foam::operator>>(Istream& is, long& val)
{
return operator>>(is, reinterpret_cast<int64_t&>(val));
......
......@@ -186,6 +186,11 @@ public:
};
#ifdef __APPLE__
//- On Darwin: unsigned long is not unambiguously (uint64_t)
template<> class pTraits<unsigned long> : pTraits<uint64_t> {};
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment