Try to fix build on newer MinGW.
[libdcp.git] / src / util.cc
index 359ac317142de7e2c33130c48cddfe2929646f4b..6f09e8aae88c9af02c9cd36ab469ed215070cbea 100644 (file)
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 #include <stdexcept>
-#include <sstream>
 #include <iostream>
 #include <iomanip>
 
 using std::string;
 using std::wstring;
 using std::cout;
-using std::stringstream;
 using std::min;
 using std::max;
 using std::list;
@@ -245,22 +243,8 @@ dcp::init ()
        if (xmlSecCryptoInit() < 0) {
                throw MiscError ("could not initialise xmlsec-crypto");
        }
-}
 
-bool dcp::operator== (dcp::Size const & a, dcp::Size const & b)
-{
-       return (a.width == b.width && a.height == b.height);
-}
-
-bool dcp::operator!= (dcp::Size const & a, dcp::Size const & b)
-{
-       return !(a == b);
-}
-
-ostream& dcp::operator<< (ostream& s, dcp::Size const & a)
-{
-       s << a.width << "x" << a.height;
-       return s;
+       OpenSSL_add_all_algorithms();
 }
 
 /** Decode a base64 string.  The base64 decode routine in KM_util.cpp
@@ -355,7 +339,7 @@ dcp::file_to_string (boost::filesystem::path p, uintmax_t max_length)
 {
        uintmax_t len = boost::filesystem::file_size (p);
        if (len > max_length) {
-               throw MiscError ("Unexpectedly long file");
+               throw MiscError (String::compose ("Unexpectedly long file (%1)", p.string()));
        }
 
        FILE* f = fopen_boost (p, "r");