From 35c4e72934ef423b416d00ebbc4c70d5fae74bc7 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 14 Jan 2018 22:48:40 +0100 Subject: [PATCH] Use our own implementation of to_string to fix the build. --- Magick++/lib/Magick++/SecurityPolicy.h | 3 +++ Magick++/lib/SecurityPolicy.cpp | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Magick++/lib/Magick++/SecurityPolicy.h b/Magick++/lib/Magick++/SecurityPolicy.h index b1b7287ae..71405639b 100644 --- a/Magick++/lib/Magick++/SecurityPolicy.h +++ b/Magick++/lib/Magick++/SecurityPolicy.h @@ -38,6 +38,9 @@ namespace Magick static bool setValue(const PolicyDomain domain_, const std::string name_, const std::string value_); + template + static std::string toString(const T& value); + }; // class SecurityPolicy } // Magick namespace diff --git a/Magick++/lib/SecurityPolicy.cpp b/Magick++/lib/SecurityPolicy.cpp index 25856d94a..754295dc9 100644 --- a/Magick++/lib/SecurityPolicy.cpp +++ b/Magick++/lib/SecurityPolicy.cpp @@ -11,6 +11,7 @@ #include "Magick++/SecurityPolicy.h" #include "Magick++/Exception.h" #include +#include using namespace std; @@ -29,7 +30,7 @@ bool Magick::SecurityPolicy::precision(const int precision_) string value; - value=std::to_string(precision_); + value=toString(precision_); return(setValue(SystemPolicyDomain,"precision",value)); } @@ -38,7 +39,7 @@ bool Magick::SecurityPolicy::maxMemoryRequest(const MagickSizeType limit_) string value; - value=std::to_string(limit_); + value=toString(limit_); return(setValue(SystemPolicyDomain,"max-memory-request",value)); } @@ -47,7 +48,7 @@ bool Magick::SecurityPolicy::shred(const int passes_) string value; - value=std::to_string(passes_); + value=toString(passes_); return(setValue(SystemPolicyDomain,"shred",value)); } @@ -66,4 +67,12 @@ bool Magick::SecurityPolicy::setValue(const PolicyDomain domain_, value_.c_str(),exceptionInfo); ThrowPPException(false); return(status != MagickFalse); +} + +template +static std::string Magick::SecurityPolicy::toString(const T& value) +{ + stringstream ss; + ss << value; + return ss.str(); } \ No newline at end of file -- 2.40.0