diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 2271f6a0e..1ec27351d 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -52,7 +52,10 @@ Description #include #include #include + +#ifndef darwin #include +#endif #include diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index 763dbf7a7..1c788fe73 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -262,7 +262,7 @@ void Foam::sigFpe::set(const bool verbose) # elif defined(__APPLE__) struct sigaction newAction; - newAction.sa_handler = sigFpeHandler; + newAction.sa_handler = sigHandler; newAction.sa_flags = SA_NODEFER; sigemptyset(&newAction.sa_mask); if (sigaction(SIGFPE, &newAction, &oldAction_) < 0) diff --git a/src/foam/primitives/Scalar/doubleFloat.H b/src/foam/primitives/Scalar/doubleFloat.H index 388e0c9a8..594f25528 100644 --- a/src/foam/primitives/Scalar/doubleFloat.H +++ b/src/foam/primitives/Scalar/doubleFloat.H @@ -31,6 +31,25 @@ License #include +#if defined(darwin) && defined(__clang__) +#ifndef DUMMY_SCALAR_FUNCTIONS +#define DUMMY_SCALAR_FUNCTIONS +inline float j0f(float x) { return float(j0(double(x)));} +inline float j1f(float x) { return float(j1(double(x)));} +inline float y0f(float x) { return float(y0(double(x)));} +inline float y1f(float x) { return float(y1(double(x)));} +inline float jnf(const int n, const float s) { return float(jn(n, double(s))); } +inline float ynf(const int n, const float s) { return float(yn(n, double(s))); } + +inline long double j0l(float x) { return double(j0(double(x)));} +inline long double j1l(float x) { return double(j1(double(x)));} +inline long double y0l(float x) { return double(y0(double(x)));} +inline long double y1l(float x) { return double(y1(double(x)));} +inline long double jnl(const int n, const float s) { return double(jn(n, double(s))); } +inline long double ynl(const int n, const float s) { return double(yn(n, double(s))); } +#endif +#endif // darwin + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/foam/primitives/ints/int64/int64.H b/src/foam/primitives/ints/int64/int64.H index e337cfe80..deb8f8a72 100644 --- a/src/foam/primitives/ints/int64/int64.H +++ b/src/foam/primitives/ints/int64/int64.H @@ -69,6 +69,11 @@ bool read(const char*, int64_t&); Istream& operator>>(Istream&, int64_t&); Ostream& operator<<(Ostream&, const int64_t); +#if WM_ARCH_OPTION == 64 && darwin && __clang__ + Istream& operator>>(Istream&, long&); + Ostream& operator<<(Ostream&, const long); +#endif + //- Template specialization for pTraits template<> class pTraits diff --git a/src/foam/primitives/ints/int64/int64IO.C b/src/foam/primitives/ints/int64/int64IO.C index 1937d7458..7a36d6047 100644 --- a/src/foam/primitives/ints/int64/int64IO.C +++ b/src/foam/primitives/ints/int64/int64IO.C @@ -101,5 +101,17 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const int64_t i) return os; } +#if WM_ARCH_OPTION == 64 && darwin && __clang__ +Foam::Istream& Foam::operator>>(Istream& is, long& i) +{ + return operator>>(is, reinterpret_cast(i)); +} + +Foam::Ostream& Foam::operator<<(Ostream& os, const long i) +{ + os << int64_t(i); + return os; +} +#endif // ************************************************************************* //