[88255] trunk/dports/net/librsync

cal at macports.org cal at macports.org
Fri Dec 23 07:15:10 PST 2011


Revision: 88255
          http://trac.macports.org/changeset/88255
Author:   cal at macports.org
Date:     2011-12-23 07:15:05 -0800 (Fri, 23 Dec 2011)
Log Message:
-----------
librsync: Fix librsync's reliance on gcc interpretations of the "inline" keyword

closes #31742, revbump will be commited later

Modified Paths:
--------------
    trunk/dports/net/librsync/Portfile

Added Paths:
-----------
    trunk/dports/net/librsync/files/c99-inline.diff

Modified: trunk/dports/net/librsync/Portfile
===================================================================
--- trunk/dports/net/librsync/Portfile	2011-12-23 12:58:53 UTC (rev 88254)
+++ trunk/dports/net/librsync/Portfile	2011-12-23 15:15:05 UTC (rev 88255)
@@ -42,6 +42,13 @@
                     patch-librsync__mdfour.h \
                     patch-librsync__patch.c
 
+if {${configure.compiler} == "clang"} {
+    # gcc by default compiles GNU89, which treats inline different than clang, which uses C99 by default
+    # see http://clang.llvm.org/compatibility.html#inline
+    # and #31742
+    patchfiles-append   c99-inline.diff
+}
+
 configure.args      --mandir=${prefix}/share/man \
                     --enable-shared
 

Added: trunk/dports/net/librsync/files/c99-inline.diff
===================================================================
--- trunk/dports/net/librsync/files/c99-inline.diff	                        (rev 0)
+++ trunk/dports/net/librsync/files/c99-inline.diff	2011-12-23 15:15:05 UTC (rev 88255)
@@ -0,0 +1,75 @@
+--- delta.c.orig	2011-12-23 15:56:32.000000000 +0100
++++ delta.c	2011-12-23 15:56:51.000000000 +0100
+@@ -125,12 +125,12 @@
+ static rs_result rs_delta_s_flush(rs_job_t *job);
+ static rs_result rs_delta_s_end(rs_job_t *job);
+ void rs_getinput(rs_job_t *job);
+-inline int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len);
+-inline rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len);
+-inline rs_result rs_appendmiss(rs_job_t *job, size_t miss_len);
+-inline rs_result rs_appendflush(rs_job_t *job);
+-inline rs_result rs_processmatch(rs_job_t *job);
+-inline rs_result rs_processmiss(rs_job_t *job);
++int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len);
++rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len);
++rs_result rs_appendmiss(rs_job_t *job, size_t miss_len);
++rs_result rs_appendflush(rs_job_t *job);
++rs_result rs_processmatch(rs_job_t *job);
++rs_result rs_processmiss(rs_job_t *job);
+ 
+ /**
+  * \brief Get a block of data if possible, and see if it matches.
+@@ -254,7 +254,7 @@
+  * forwards beyond the block boundaries. Extending backwards would require
+  * decrementing scoop_pos as appropriate.
+  */
+-inline int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len) {
++int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len) {
+     /* calculate the weak_sum if we don't have one */
+     if (job->weak_sum.count == 0) {
+         /* set match_len to min(block_len, scan_avail) */
+@@ -281,7 +281,7 @@
+ /**
+  * Append a match at match_pos of length match_len to the delta, extending
+  * a previous match if possible, or flushing any previous miss/match. */
+-inline rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len)
++rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len)
+ {
+     rs_result result=RS_DONE;
+     
+@@ -312,7 +312,7 @@
+  * 
+  * This also breaks misses up into block_len segments to avoid accumulating
+  * too much in memory. */
+-inline rs_result rs_appendmiss(rs_job_t *job, size_t miss_len)
++rs_result rs_appendmiss(rs_job_t *job, size_t miss_len)
+ {
+     rs_result result=RS_DONE;
+     
+@@ -329,7 +329,7 @@
+ /**
+  * Flush any accumulating hit or miss, appending it to the delta.
+  */
+-inline rs_result rs_appendflush(rs_job_t *job)
++rs_result rs_appendflush(rs_job_t *job)
+ {
+     /* if last is a match, emit it and reset last by resetting basis_len */
+     if (job->basis_len) {
+@@ -360,7 +360,7 @@
+  * scoop_pos appropriately. In the future this could be used for something
+  * like context compressing of miss data. Note that it also calls
+  * rs_tube_catchup to output any pending output. */
+-inline rs_result rs_processmatch(rs_job_t *job)
++rs_result rs_processmatch(rs_job_t *job)
+ {
+     job->scoop_avail-=job->scoop_pos;
+     job->scoop_next+=job->scoop_pos;
+@@ -382,7 +382,7 @@
+  * 
+  * In the future this could do compression of miss data before outputing
+  * it. */
+-inline rs_result rs_processmiss(rs_job_t *job)
++rs_result rs_processmiss(rs_job_t *job)
+ {
+     rs_tube_copy(job, job->scoop_pos);
+     job->scoop_pos=0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111223/d8ed32d7/attachment.html>


More information about the macports-changes mailing list