Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : proto/evil

Dir     : e17/proto/evil/src/lib/mman


Modified Files:
        mman.c 


Log Message:
* src/lib/Evil.h:
add strdup define
* src/lib/evil.c: (evil_tmpdir_get), (evil_homedir_get):
include stdlib.h to define MB_CUR_MAX
On Windows CE, tmpdir and homedir are defined as "\windows"
* src/lib/mman/mman.c: (mmap), (munmap):
compile the big fat hack of mmap only on Windows CE

===================================================================
RCS file: /cvs/e/e17/proto/evil/src/lib/mman/mman.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- mman.c      8 Jun 2008 21:39:49 -0000       1.6
+++ mman.c      9 Jun 2008 18:35:49 -0000       1.7
@@ -43,7 +43,6 @@
      off_t  offset)
 {
    OSVERSIONINFO os_version;
-   void  *data;
 
    os_version.dwOSVersionInfoSize = sizeof(os_version);
    if (!GetVersionEx(&os_version))
@@ -57,9 +56,11 @@
         return MAP_FAILED;
      }
 
+#ifdef _WIN32_WCE
    if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_CE) &&
        (os_version.dwMajorVersion < 5))
      {
+        void  *data;
         size_t size;
 
         data = malloc(len);
@@ -83,13 +84,17 @@
              free(data);
              return MAP_FAILED;
           }
+
+        return data;
      }
    else
+#endif /* ! _WIN32_WCE */
      {
         HANDLE fm;
         DWORD  protect = PAGE_NOACCESS;
         DWORD  access = 0;
         HANDLE handle;
+        void  *data;
 
         /* support only MAP_SHARED */
         if (!(flags & MAP_SHARED))
@@ -178,15 +183,16 @@
 
              return MAP_FAILED;
           }
-     }
 
-   return data;
+        return data;
+     }
 }
 
 int
 munmap(void  *addr,
        size_t len __UNUSED__)
 {
+#ifdef _WIN32_WCE
    OSVERSIONINFO os_version;
 
    os_version.dwOSVersionInfoSize = sizeof(os_version);
@@ -210,6 +216,7 @@
         return 0;
      }
    else
+#endif /* ! _WIN32_WCE */
      {
         BOOL res;
 



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to