]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Before windows test.
authorageay <ageay>
Tue, 21 Sep 2010 11:23:06 +0000 (11:23 +0000)
committerageay <ageay>
Tue, 21 Sep 2010 11:23:06 +0000 (11:23 +0000)
src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx

index 704b6afc8522393a4810ff884282dbe41a531b21..585fac2f832a1ff3d6c4162e90854de62a304efb 100644 (file)
@@ -31,6 +31,9 @@
 #ifdef _POSIX_MAPPED_FILES
 #include <sys/mman.h>
 #else
+#ifdef WNT
+#include <windows.h>
+#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;
 }