From 8558d370f0a97aa43974a7465e5bf5c603f5027e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 13 Jun 2013 09:07:38 +0000 Subject: [PATCH] shared pointer is now from std C++/11; refs #26 --- NEWS | 5 +++++ libpcscxx.spec.in | 2 +- src/pcsc.hxx | 10 ++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index e69de29..02a99fd 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,5 @@ +Now requires a C++ 11 compiler. + +For gcc, configure with: + + CPPFLAGS=-std=c++0x ./configure \ No newline at end of file diff --git a/libpcscxx.spec.in b/libpcscxx.spec.in index 4ef9c7c..44fc16a 100644 --- a/libpcscxx.spec.in +++ b/libpcscxx.spec.in @@ -6,7 +6,7 @@ License: LGPL Group: Development/Libraries/C++ URL: https://dev.marc.waeckerlin.org/projects/@PACKAGENAME@ Source0: %{name}-%{version}.tar.gz -BuildRequires: subversion gcc-c++ doxygen graphviz texlive automake autoconf libtool make pcsc-lite-devel boost-devel +BuildRequires: subversion gcc-c++ doxygen graphviz texlive automake autoconf libtool make pcsc-lite-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} BuildRequires: cppunit-devel openssl-devel diff --git a/src/pcsc.hxx b/src/pcsc.hxx index 544f5fd..2693e98 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -73,7 +73,6 @@ } #endif -#include #include #include #include @@ -257,7 +256,6 @@ namespace pcsc { claInsP1P2.push_back(ins); claInsP1P2.push_back(p1); claInsP1P2.push_back(p2); - assert(claInsP1P2.size()==4); return transmit(claInsP1P2, lc, le); } @@ -270,7 +268,6 @@ namespace pcsc { claInsP1P2.push_back(ins); claInsP1P2.push_back(p1); claInsP1P2.push_back(p2); - assert(claInsP1P2.size()==4); return transmit(claInsP1P2, std::string(), le); } @@ -284,7 +281,6 @@ namespace pcsc { claInsP1P2.push_back(ins); claInsP1P2.push_back(p1); claInsP1P2.push_back(p2); - assert(claInsP1P2.size()==4); return transmit(claInsP1P2, std::string(lc, len), le); } @@ -523,7 +519,9 @@ namespace pcsc { connection to the reader, then access it. */ Reader& reader(const std::string& name) { if (_reader.find(name)==_reader.end()) - _reader.insert(std::make_pair(name, new Reader(name, *this))); + _reader.insert + (std::make_pair + (name, std::shared_ptr(new Reader(name, *this)))); return *_reader.find(name)->second; } @@ -832,7 +830,7 @@ namespace pcsc { bool _exc; SCARDCONTEXT _id; long _state; - std::map > _reader; + std::map > _reader; };