mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 06:17:15 +01:00
OpenSolaris + SunPro C++ compile fix
This commit is contained in:
parent
ef850957c5
commit
b99f4b6d1f
@ -155,7 +155,9 @@ public:
|
||||
/// when already another element was present, in this case Iterator
|
||||
/// points to that other element)
|
||||
{
|
||||
return insert(std::make_pair(key, value));
|
||||
// fix: SunPro C++ is silly ...
|
||||
ValueType valueType(key,value);
|
||||
return insert(valueType);
|
||||
}
|
||||
|
||||
inline InsRetVal insert(const ValueType& aPair)
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include <sys/utsname.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
@ -206,8 +205,11 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
|
||||
// General Unix
|
||||
//
|
||||
#include <sys/ioctl.h>
|
||||
#if defined(sun) || defined(__sun)
|
||||
#if defined(sun) || defined(__sun) || defined(__sun__)
|
||||
#define __EXTENSIONS__
|
||||
#include <net/if_arp.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <stropts.h>
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
@ -219,7 +221,6 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
|
||||
#include <net/if_arp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#define __EXTENSIONS__
|
||||
#include <math.h>
|
||||
#include "Poco/FPEnvironment_SUN.h"
|
||||
|
||||
|
@ -34,6 +34,10 @@
|
||||
//
|
||||
|
||||
|
||||
#if defined(sun) || defined(__sun) || defined(__sun__)
|
||||
#define __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
#include "Poco/Net/MulticastSocket.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include <cstring>
|
||||
|
@ -33,6 +33,10 @@
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if defined(sun) || defined(__sun) || defined(__sun__)
|
||||
#define __EXTENSIONS__
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
#include "Poco/Net/NetworkInterface.h"
|
||||
#include "Poco/Net/DatagramSocket.h"
|
||||
@ -44,7 +48,6 @@
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
using Poco::FastMutex;
|
||||
|
||||
|
@ -43,7 +43,10 @@
|
||||
#if defined(POCO_HAVE_FD_POLL)
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__sun) || defined(__sun__)
|
||||
#include <unistd.h>
|
||||
#include <stropts.h>
|
||||
#endif
|
||||
|
||||
using Poco::IOException;
|
||||
using Poco::TimeoutException;
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "Poco/Zip/Zip.h"
|
||||
#include "Poco/Zip/ParseCallback.h"
|
||||
#include "Poco/Zip/ZipLocalFileHeader.h"
|
||||
#include "Poco/Path.h"
|
||||
#include "Poco/FIFOEvent.h"
|
||||
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
HS_MVS = 15,
|
||||
HS_BEOS = 16,
|
||||
HS_TANDEM = 17,
|
||||
HS_UNUSED = 18,
|
||||
HS_UNUSED = 18
|
||||
};
|
||||
|
||||
enum FileType
|
||||
|
@ -314,7 +314,9 @@ ZipArchive Compress::close()
|
||||
std::string centr(central.createHeader());
|
||||
_out.write(centr.c_str(), static_cast<std::streamsize>(centr.size()));
|
||||
_out.flush();
|
||||
_dirs.insert(std::make_pair(0, central));
|
||||
// SunPro C++ fix
|
||||
std::pair<UInt16, ZipArchiveInfo> par(0, central);
|
||||
_dirs.insert(par);
|
||||
return ZipArchive(_files, _infos, _dirs);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
std::ofstream out(dest.toString().c_str(), std::ios::binary);
|
||||
if (!out)
|
||||
{
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Failed to open output stream " + dest.toString());
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "Failed to open output stream " + dest.toString());
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
@ -138,7 +138,7 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
Poco::File aFile(file);
|
||||
if (!aFile.exists() || !aFile.isFile())
|
||||
{
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Failed to create output stream " + dest.toString());
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "Failed to create output stream " + dest.toString());
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
@ -147,7 +147,7 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
{
|
||||
if (!_keepIncompleteFiles)
|
||||
aFile.remove();
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "CRC mismatch. Corrupt file: " + dest.toString());
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "CRC mismatch. Corrupt file: " + dest.toString());
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
@ -158,23 +158,23 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
{
|
||||
if (!_keepIncompleteFiles)
|
||||
aFile.remove();
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Filesizes do not match. Corrupt file: " + dest.toString());
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "Filesizes do not match. Corrupt file: " + dest.toString());
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<const ZipLocalFileHeader, const Poco::Path> tmp = std::make_pair(hdr, file);
|
||||
std::pair<const ZipLocalFileHeader, const Poco::Path> tmp(hdr, file);
|
||||
EOk.notify(this, tmp);
|
||||
}
|
||||
catch (Poco::Exception& e)
|
||||
{
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Exception: " + e.displayText());
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "Exception: " + e.displayText());
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Unknown Exception");
|
||||
std::pair<const ZipLocalFileHeader, const std::string> tmp(hdr, "Unknown Exception");
|
||||
EError.notify(this, tmp);
|
||||
return false;
|
||||
}
|
||||
@ -185,7 +185,9 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
|
||||
void Decompress::onOk(const void*, std::pair<const ZipLocalFileHeader, const Poco::Path>& val)
|
||||
{
|
||||
_mapping.insert(std::make_pair(val.first.getFileName(), val.second));
|
||||
// std::pair<std::string,Poco::Path> par(val.first.getFileName(), val.second);
|
||||
ZipMapping::value_type p(val.first.getFileName(), val.second);
|
||||
_mapping.insert(p);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user