Please let me know if the attached patch fixes this problem. I also tried to fix the Solaris compile problem - Kayvan, could you please test it?
I still need to get the proper DepTable patch out. The patch that is currently in 1.2 is b0rken. Ben. Jean-Marc Lasgouttes wrote: >>>>>>"Ben" == Ben Stanley <[EMAIL PROTECTED]> writes: >>>>>> > >Ben> This is a version of the mmap patch which applies to cvs HEAD. > >Compilation of 1.2.0cvs with compaq cxx dies with: > >cxx: Error: ../../../lyx-devel/src/support/lyxsum.C, line 43: operand types > are incompatible ("void *" and "long") > if (mm == MAP_FAILED) { >---------------^ > >I guess some cast is needed. > >This probably mean that this patch is too risky to go into 1.1.6fix4, >unfortunately. > >JMarc >
--- lyx-devel-orig/src/support/ChangeLog Thu Dec 6 12:28:42 2001 +++ lyx-devel/src/support/ChangeLog Thu Dec 6 12:35:48 2001 @@ -1,3 +1,7 @@ +2001-12-06 Ben Stanley <[EMAIL PROTECTED]> + + * lyxsum.C: small compaq cxx and Solaris fixes for mmap. + 2001-12-05 Lars Gullik Bjønnes <[EMAIL PROTECTED]> * filetools.C: --- lyx-devel-orig/src/support/lyxsum.C Thu Dec 6 12:28:42 2001 +++ lyx-devel/src/support/lyxsum.C Thu Dec 6 12:35:39 2001 @@ -27,6 +27,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> +#define _POSIX_C_SOURCE 3 #include <sys/mman.h> unsigned long lyx::sum(string const & file) @@ -40,7 +41,7 @@ void * mm = mmap(0, info.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if (mm == MAP_FAILED) { + if (mm == reinterpret_cast<void*>(MAP_FAILED)) { close(fd); return 0; }