[llvm-commits] [llvm] r49036 - /llvm/trunk/lib/System/Unix/Path.inc

Chris Lattner sabre at nondot.org
Mon Mar 31 23:25:23 PDT 2008


Author: lattner
Date: Tue Apr  1 01:25:23 2008
New Revision: 49036

URL: http://llvm.org/viewvc/llvm-project?rev=49036&view=rev
Log:
add some #includes.

Modified:
    llvm/trunk/lib/System/Unix/Path.inc

Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=49036&r1=49035&r2=49036&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Tue Apr  1 01:25:23 2008
@@ -24,6 +24,12 @@
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
 #if HAVE_UTIME_H
 #include <utime.h>
 #endif
@@ -753,11 +759,11 @@
   void *BasePtr = ::mmap(0, FileSize, PROT_READ, Flags, FD, 0);
   if (BasePtr == MAP_FAILED)
     return 0;
-  return BasePtr;
+  return (const char*)BasePtr;
 }
 
 void Path::UnMapFilePages(const char *BasePtr, uint64_t FileSize) {
-  ::munmap(BasePtr, FileSize);
+  ::munmap((void*)BasePtr, FileSize);
 }
 
 } // end llvm namespace





More information about the llvm-commits mailing list