From: Dan Breslau Date: Fri, 28 Oct 2016 20:46:33 +0000 (-0400) Subject: Use unique_ptr if available; else fall back to auto_ptr X-Git-Tag: v1.0.0~6 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=commitdiff_plain;h=6055f4f86d19a9df7ac06317b3aacf3c38cab559 Use unique_ptr if available; else fall back to auto_ptr --- diff --git a/mech_eap/util_shib.cpp b/mech_eap/util_shib.cpp index f919fc0..875c9a5 100644 --- a/mech_eap/util_shib.cpp +++ b/mech_eap/util_shib.cpp @@ -66,6 +66,7 @@ #include #include +#include using namespace shibsp; using namespace shibresolver; @@ -78,6 +79,14 @@ using namespace opensaml; using namespace xercesc; #endif +// Use unique_ptr where available; auto_ptr otherwise. +#if __cplusplus > 199711L +#define UNIQUE_OR_AUTO_PTR unique_ptr +#else +#define UNIQUE_OR_AUTO_PTR auto_ptr +#endif + + gss_eap_shib_attr_provider::gss_eap_shib_attr_provider(void) { m_initialized = false; @@ -123,7 +132,7 @@ gss_eap_shib_attr_provider::initWithGssContext(const gss_eap_attr_ctx *manager, if (!gss_eap_attr_provider::initWithGssContext(manager, gssCred, gssCtx)) return false; - unique_ptr resolver(ShibbolethResolver::create()); + UNIQUE_OR_AUTO_PTR resolver(ShibbolethResolver::create()); /* * For now, leave ApplicationID defaulted.