summaryrefslogtreecommitdiff
path: root/lib/System/Unix/Path.inc
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-01 06:25:23 +0000
committerChris Lattner <sabre@nondot.org>2008-04-01 06:25:23 +0000
commit14c762d82f502b36adfcce235a7869552932459f (patch)
treeb45a8f8846217e480a44ba3195f014cab8e07be0 /lib/System/Unix/Path.inc
parent98b7e612b2320ae83d2896b7828ea591a9bb7345 (diff)
downloadllvm-14c762d82f502b36adfcce235a7869552932459f.tar.gz
llvm-14c762d82f502b36adfcce235a7869552932459f.tar.bz2
llvm-14c762d82f502b36adfcce235a7869552932459f.tar.xz
add some #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/Path.inc')
-rw-r--r--lib/System/Unix/Path.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 0707de6458..2f24b893c6 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -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 @@ 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