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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6932
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     1
Changes needed to allow libtorrent to compile with g++ and the Solaris
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     2
version of madvise.
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     3
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     4
These changes should be sent upstream if they can be adjusted to an
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     5
acceptable form.
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     6
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     7
--- libtorrent-0.13.6/scripts/common.m4.orig	2016-09-15 17:07:33.144629366 +0000
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     8
+++ libtorrent-0.13.6/scripts/common.m4	2016-09-15 17:08:17.259446458 +0000
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
     9
@@ -171,7 +171,7 @@
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    10
   AC_COMPILE_IFELSE([AC_LANG_SOURCE([
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    11
       #include <sys/types.h>
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    12
       #include <sys/mman.h>
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    13
-        void f() { static char test@<:@1024@:>@; madvise((void *)test, sizeof(test), MADV_NORMAL); }
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    14
+        void f() { static char test@<:@1024@:>@; madvise((char *)test, sizeof(test), MADV_NORMAL); }
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    15
       ])],
248
3011f7a1ed77 7046137 move *torrent to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    16
     [
3011f7a1ed77 7046137 move *torrent to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    17
       AC_MSG_RESULT(yes)
6932
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    18
--- libtorrent-0.13.6/src/data/memory_chunk.cc.orig	2016-09-15 17:08:59.127701605 +0000
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    19
+++ libtorrent-0.13.6/src/data/memory_chunk.cc	2016-09-15 17:24:27.343279729 +0000
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    20
@@ -45,7 +45,7 @@
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    21
 #include "memory_chunk.h"
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    22
 
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    23
 #ifdef __sun__
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    24
-extern "C" int madvise(void *, size_t, int);
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    25
+extern "C" int madvise(caddr_t, size_t, int);
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    26
 //#include <sys/mman.h>
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    27
 //Should be the include line instead, but Solaris
ae9e3811b2ec 21849039 update libtorrent to 0.13.6
Rich Burridge <rich.burridge@oracle.com>
parents: 248
diff changeset
    28
 //has an annoying bug wherein it doesn't declare