File par2-fix-compile.diff of Package par2
Index: par2cmdline-0.4/reedsolomon.cpp
===================================================================
--- par2cmdline-0.4.orig/reedsolomon.cpp
+++ par2cmdline-0.4/reedsolomon.cpp
@@ -51,6 +51,7 @@ u32 gcd(u32 a, u32 b)
}
}
+template <>
bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
{
inputcount = (u32)present.size();
@@ -80,6 +81,7 @@ bool ReedSolomon<Galois8>::SetInput(cons
return true;
}
+template <>
bool ReedSolomon<Galois8>::SetInput(u32 count)
{
inputcount = count;
@@ -101,6 +103,7 @@ bool ReedSolomon<Galois8>::SetInput(u32
return true;
}
+template <>
bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
{
// Look up the appropriate element in the RS matrix
@@ -189,6 +192,7 @@ bool ReedSolomon<Galois8>::Process(size_
// Set which of the source files are present and which are missing
// and compute the base values to use for the vandermonde matrix.
+template <>
bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
{
inputcount = (u32)present.size();
@@ -233,6 +237,7 @@ bool ReedSolomon<Galois16>::SetInput(con
// Record that the specified number of source files are all present
// and compute the base values to use for the vandermonde matrix.
+template <>
bool ReedSolomon<Galois16>::SetInput(u32 count)
{
inputcount = count;
@@ -267,6 +272,7 @@ bool ReedSolomon<Galois16>::SetInput(u32
return true;
}
+template <>
bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
{
// Look up the appropriate element in the RS matrix
Index: par2cmdline-0.4/md5.h
===================================================================
--- par2cmdline-0.4.orig/md5.h
+++ par2cmdline-0.4/md5.h
@@ -31,9 +31,12 @@
// MD5Hash hash;
// context.Final(hash);
-
-
-// MD5 Hash value
+#ifdef WIN32
+#pragma pack(push, 1)
+#define PACKED
+#else
+#define PACKED __attribute__ ((packed))
+#endif
class MD5Hash
{
@@ -60,7 +63,7 @@ public:
public:
u8 hash[16]; // 16 byte MD5 Hash value
-};
+} PACKED;
// Intermediate computation state
Index: par2cmdline-0.4/criticalpacket.cpp
===================================================================
--- par2cmdline-0.4.orig/criticalpacket.cpp
+++ par2cmdline-0.4/criticalpacket.cpp
@@ -29,7 +29,7 @@ static char THIS_FILE[]=__FILE__;
bool CriticalPacket::WritePacket(DiskFile &diskfile, u64 fileoffset) const
{
- assert(&diskfile != 0 && packetdata != 0 && packetlength != 0);
+ assert(/*&diskfile != 0 &&*/ packetdata != 0 && packetlength != 0);
return diskfile.Write(fileoffset, packetdata, packetlength);
}