aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/par2.rb27
1 files changed, 21 insertions, 6 deletions
diff --git a/Library/Formula/par2.rb b/Library/Formula/par2.rb
index e2ee8d2b2..aae7e8f2a 100644
--- a/Library/Formula/par2.rb
+++ b/Library/Formula/par2.rb
@@ -9,12 +9,12 @@ class Par2 < Formula
:because => "par2 and par2tbb install the same binaries."
def patches
- "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch?revision=1.1"
- end
-
- fails_with :clang do
- build 318
- cause "./par2fileformat.h:87:25: error: flexible array member 'entries' of non-POD element type 'FILEVERIFICATIONENTRY []'"
+ [
+ # Fixes compilation with GCC 4 and still required for clang
+ "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch?revision=1.1",
+ # Clang doesn't like variable length arrays of non-POD types.
+ DATA
+ ]
end
def install
@@ -23,3 +23,18 @@ class Par2 < Formula
system "make install"
end
end
+
+__END__
+diff --git a/par2fileformat.h b/par2fileformat.h
+index 9920b24..248cfaf 100644
+--- a/par2fileformat.h
++++ b/par2fileformat.h
+@@ -84,7 +84,7 @@ struct FILEVERIFICATIONPACKET
+ PACKET_HEADER header;
+ // Body
+ MD5Hash fileid; // MD5hash of file_hash_16k, file_length, file_name
+- FILEVERIFICATIONENTRY entries[];
++ FILEVERIFICATIONENTRY entries[0];
+ } PACKED;
+
+ // The file description packet is used to record the name of the file,