components/libtorrent/patches/rlibtorrent-01-madvise.patch
author Rich Burridge <rich.burridge@oracle.com>
Tue, 02 May 2017 17:33:26 -0700
changeset 7964 d9801318ed3d
parent 6932 ae9e3811b2ec
permissions -rw-r--r--
25981468 Build ilmbase and openexr with the GNU compilers

Changes needed to allow libtorrent to compile with g++ and the Solaris
version of madvise.

These changes should be sent upstream if they can be adjusted to an
acceptable form.

--- libtorrent-0.13.6/scripts/common.m4.orig	2016-09-15 17:07:33.144629366 +0000
+++ libtorrent-0.13.6/scripts/common.m4	2016-09-15 17:08:17.259446458 +0000
@@ -171,7 +171,7 @@
   AC_COMPILE_IFELSE([AC_LANG_SOURCE([
       #include <sys/types.h>
       #include <sys/mman.h>
-        void f() { static char test@<:@1024@:>@; madvise((void *)test, sizeof(test), MADV_NORMAL); }
+        void f() { static char test@<:@1024@:>@; madvise((char *)test, sizeof(test), MADV_NORMAL); }
       ])],
     [
       AC_MSG_RESULT(yes)
--- libtorrent-0.13.6/src/data/memory_chunk.cc.orig	2016-09-15 17:08:59.127701605 +0000
+++ libtorrent-0.13.6/src/data/memory_chunk.cc	2016-09-15 17:24:27.343279729 +0000
@@ -45,7 +45,7 @@
 #include "memory_chunk.h"
 
 #ifdef __sun__
-extern "C" int madvise(void *, size_t, int);
+extern "C" int madvise(caddr_t, size_t, int);
 //#include <sys/mman.h>
 //Should be the include line instead, but Solaris
 //has an annoying bug wherein it doesn't declare