From b2a9b4c2e1e3061ea955975b7ad5a1b0f0d2352a Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 30 Nov 2015 16:07:27 +0100 Subject: [PATCH] APPLE portability (thanks Antoine G.) --- src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx | 4 ++++ src/INTERP_KERNEL/InterpolationUtils.hxx | 2 +- src/INTERP_KERNEL/PolygonAlgorithms.hxx | 2 +- src/MEDLoader/SauvMedConvertor.cxx | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx b/src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx index aaeeabf14..081cab633 100644 --- a/src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx +++ b/src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx @@ -47,7 +47,11 @@ char *INTERP_KERNEL::AsmX86::copyToExecMemZone(const std::vector& ml, unsi char *ret=0; int lgth=ml.size(); #ifdef _POSIX_MAPPED_FILES +# ifdef __APPLE__ + ret=(char *)mmap(0,lgth,PROT_EXEC | PROT_WRITE,MAP_ANON | MAP_PRIVATE,-1,0); +# else ret=(char *)mmap(0,lgth,PROT_EXEC | PROT_WRITE,MAP_ANONYMOUS | MAP_PRIVATE,-1,0); +# endif #else #ifdef WIN32 HANDLE h=CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_EXECUTE_READWRITE,0,lgth,NULL); diff --git a/src/INTERP_KERNEL/InterpolationUtils.hxx b/src/INTERP_KERNEL/InterpolationUtils.hxx index dd3ffef94..a96072b78 100644 --- a/src/INTERP_KERNEL/InterpolationUtils.hxx +++ b/src/INTERP_KERNEL/InterpolationUtils.hxx @@ -710,7 +710,7 @@ namespace INTERP_KERNEL class AngleLess { public: - bool operator()(std::pairtheta1, std::pair theta2) + bool operator()(std::pairtheta1, std::pair theta2) const { double norm1 = sqrt(theta1.first*theta1.first +theta1.second*theta1.second); double norm2 = sqrt(theta2.first*theta2.first +theta2.second*theta2.second); diff --git a/src/INTERP_KERNEL/PolygonAlgorithms.hxx b/src/INTERP_KERNEL/PolygonAlgorithms.hxx index bbb49362a..5d9f9d818 100644 --- a/src/INTERP_KERNEL/PolygonAlgorithms.hxx +++ b/src/INTERP_KERNEL/PolygonAlgorithms.hxx @@ -30,7 +30,7 @@ namespace INTERP_KERNEL class VertexLess { public: - bool operator()(const double * P_1, const double * P_2) + bool operator()(const double * P_1, const double * P_2) const { for(int idim=0; idim #include #endif @@ -209,7 +210,7 @@ namespace */ struct TCellByIDCompare { - bool operator () (const Cell* i1, const Cell* i2) + bool operator () (const Cell* i1, const Cell* i2) const { return i1->_number < i2->_number; } -- 2.39.2