Fix bugs in mmap()-of-files test program on Mac OS X:

1) MAP_FAILED is declared to be a pointer
2) can't include sys/mman.h before sys/types.h without getting an error :-(

llvm-svn: 8947
This commit is contained in:
Brian Gaeke 2003-10-07 21:33:27 +00:00
parent c64016dfde
commit bdf295cb6e
1 changed files with 5 additions and 5 deletions

View File

@ -6111,21 +6111,21 @@ ac_cv_func_mmap_file,
[AC_LANG_SAVE [AC_LANG_SAVE
AC_LANG_C AC_LANG_C
AC_TRY_RUN([ AC_TRY_RUN([
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
#include <fcntl.h> #include <fcntl.h>
#endif #endif
int fd; int fd;
int main () { int main () {
fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != MAP_FAILED);}], fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != (int) MAP_FAILED);}],
ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no) ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no)
AC_LANG_RESTORE AC_LANG_RESTORE
]) ])