From 9fbc9c0daeec2564ab2163a05e7e393913f8fb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 13 Jun 2013 11:59:22 +0000 Subject: [PATCH] work-around with pcsc::shared_ptr::t; refs #26 --- src/pcsc.hxx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/pcsc.hxx b/src/pcsc.hxx index d00bf5a..154f901 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -73,13 +73,18 @@ } #endif -#ifdef NO_CXX2011 -#warning Old compiler (pre 2011): using boost as replacement for std +#if __cplusplus > 199711L + namespace pcsc { + template struct shared_ptr { + typedef std::shared_ptr t; + }; + } +#else + #warning Old compiler (pre 2011): using boost as replacement for std #include - namespace std { - template class shared_ptr: public boost::shared_ptr { - public: - shared_ptr(T* p): boost::shared_ptr(p) {} + namespace pcsc { + template struct shared_ptr { + typedef boost::shared_ptr t; }; } #endif @@ -532,7 +537,7 @@ namespace pcsc { if (_reader.find(name)==_reader.end()) _reader.insert (std::make_pair - (name, std::shared_ptr(new Reader(name, *this)))); + (name, shared_ptr::t(new Reader(name, *this)))); return *_reader.find(name)->second; } @@ -841,7 +846,7 @@ namespace pcsc { bool _exc; SCARDCONTEXT _id; long _state; - std::map > _reader; + std::map::t > _reader; };