add some #includes.
authorChris Lattner <sabre@nondot.org>
Tue, 1 Apr 2008 06:25:23 +0000 (06:25 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 Apr 2008 06:25:23 +0000 (06:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49036 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Path.inc

index 0707de645835455c0aca000a089a44853c40bbc3..2f24b893c64819ffd4c79921896a42bd9faea6b7 100644 (file)
 #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 @@ const char *Path::MapInFilePages(int FD, uint64_t FileSize) {
   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