From: ageay Date: Tue, 21 Sep 2010 11:23:06 +0000 (+0000) Subject: Before windows test. X-Git-Tag: V5_1_main_FINAL~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0163cf45463a40cd0b4f7393e11fc0a180dc7b16;p=tools%2Fmedcoupling.git Before windows test. --- diff --git a/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx b/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx index 704b6afc8..585fac2f8 100644 --- a/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx +++ b/src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx @@ -31,6 +31,9 @@ #ifdef _POSIX_MAPPED_FILES #include #else +#ifdef WNT +#include +#endif #endif using namespace INTERP_KERNEL; @@ -721,9 +724,14 @@ char *ExprParser::compileX86() const char *ret=0; #ifdef _POSIX_MAPPED_FILES ret=(char *)mmap(0,lgth,PROT_EXEC | PROT_WRITE,MAP_ANONYMOUS | MAP_PRIVATE,-1,0); - std::copy(lm,lm+lgth,ret); #else +#ifdef WNT + HANDLE h=CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_EXECUTE_READWRITE,0,lgth,NULL); + ret=(char *)MapViewOfFile(h,FILE_MAP_EXECUTE | FILE_MAP_READ | FILE_MAP_WRITE,0,0,lgth); +#endif #endif + if(ret) + std::copy(lm,lm+lgth,ret); delete [] lm; return ret; } @@ -754,9 +762,14 @@ char *ExprParser::compileX86_64() const char *ret=0; #ifdef _POSIX_MAPPED_FILES ret=(char *)mmap(0,lgth,PROT_EXEC | PROT_WRITE,MAP_ANONYMOUS | MAP_PRIVATE,-1,0); - std::copy(lm,lm+lgth,ret); #else +#ifdef WNT + HANDLE h=CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_EXECUTE_READWRITE,0,lgth,NULL); + ret=(char *)MapViewOfFile(h,FILE_MAP_EXECUTE | FILE_MAP_READ | FILE_MAP_WRITE,0,0,lgth); +#endif #endif + if(ret) + std::copy(lm,lm+lgth,ret); delete [] lm; return ret; }