work-around with pcsc::shared_ptr<T>::t; refs #26
This commit is contained in:
		
							
								
								
									
										21
									
								
								src/pcsc.hxx
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								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<typename T> struct shared_ptr { | ||||
|         typedef std::shared_ptr<T> t; | ||||
|     }; | ||||
|   } | ||||
| #else | ||||
|   #warning Old compiler (pre 2011): using boost as replacement for std | ||||
|   #include <boost/shared_ptr.hpp> | ||||
|   namespace std { | ||||
|     template<class T> class shared_ptr: public boost::shared_ptr<T> { | ||||
|       public: | ||||
|         shared_ptr(T* p): boost::shared_ptr<T>(p) {} | ||||
|   namespace pcsc { | ||||
|     template<typename T> struct shared_ptr { | ||||
|         typedef boost::shared_ptr<T> t; | ||||
|     }; | ||||
|   } | ||||
| #endif | ||||
| @@ -532,7 +537,7 @@ namespace pcsc { | ||||
|         if (_reader.find(name)==_reader.end()) | ||||
|           _reader.insert | ||||
|             (std::make_pair | ||||
|              (name, std::shared_ptr<Reader>(new Reader(name, *this)))); | ||||
|              (name, shared_ptr<Reader>::t(new Reader(name, *this)))); | ||||
|         return *_reader.find(name)->second; | ||||
|       } | ||||
|  | ||||
| @@ -841,7 +846,7 @@ namespace pcsc { | ||||
|       bool _exc; | ||||
|       SCARDCONTEXT _id; | ||||
|       long _state; | ||||
|       std::map<std::string, std::shared_ptr<Reader> > _reader; | ||||
|       std::map<std::string, shared_ptr<Reader>::t > _reader; | ||||
|  | ||||
|   }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user