Skip to content

Commit 28d48b9

Browse files
author
Sebastiano Merlino
committed
Solved problems when compiling with C++11 active
1 parent 895c875 commit 28d48b9

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

configure.ac

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ if test x"have_gnutls" = x"yes"; then
121121
fi
122122

123123
AC_MSG_CHECKING([whether to use c++0x std classes])
124-
AC_ARG_ENABLE([cpp0x],
125-
[AS_HELP_STRING([--enable-cpp0x],
126-
[enable c++0x std classes (def=no)])],
127-
[cpp0x="$enableval"],
128-
[cpp0x=no])
129-
AC_MSG_RESULT([$cpp0x])
130-
131-
if test x"$cpp0x" = x"yes"; then
132-
AC_DEFINE([CPP0X],[],[c++0x Mode])
133-
AM_CXXFLAGS="$AM_CXXFLAGS -DUSE_CPP_ZEROX -std=c++0x"
124+
AC_ARG_ENABLE([cpp11],
125+
[AS_HELP_STRING([--enable-cpp11],
126+
[enable c++11 std classes (def=no)])],
127+
[cpp11="$enableval"],
128+
[cpp11=no])
129+
AC_MSG_RESULT([$cpp11])
130+
131+
if test x"$cpp11" = x"yes"; then
132+
AC_DEFINE([CPP11],[],[c++11 Mode])
133+
AM_CXXFLAGS="$AM_CXXFLAGS -DUSE_CPP_11 --std=c++11"
134134
else
135-
AC_DEFINE([NCPP0X],[],[standard Mode])
135+
AC_DEFINE([NCPP11],[],[standard Mode])
136136
fi
137137

138138
DX_HTML_FEATURE(ON)
@@ -176,5 +176,5 @@ AC_MSG_NOTICE([Configuration Summary:
176176
License : LGPL only
177177
Debug : ${debugit}
178178
TLS Enabled : ${have_gnutls}
179-
C++0x : ${cpp0x}
179+
C++11 : ${cpp11}
180180
])

src/httpserver/webserver.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333
#include <cstring>
3434
#include <map>
3535
#include <vector>
36-
#ifdef USE_CPP_ZEROX
37-
#include <unordered_set>
38-
#else
3936
#include <set>
40-
#endif
4137
#include <string>
4238
#include <utility>
4339
#include <memory>
@@ -235,13 +231,8 @@ class webserver
235231
std::map<std::string, details::cache_entry*> response_cache;
236232
int next_to_choose;
237233
pthread_rwlock_t cache_guard;
238-
#ifdef USE_CPP_ZEROX
239-
std::unordered_set<http::ip_representation> bans;
240-
std::unordered_set<http::ip_representation> allowances;
241-
#else
242234
std::set<http::ip_representation> bans;
243235
std::set<http::ip_representation> allowances;
244-
#endif
245236

246237
std::map<http::httpserver_ska, std::deque<std::string> > q_messages;
247238
std::map<std::string, std::set<http::httpserver_ska> > q_waitings;

src/webserver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ bool webserver::register_resource(
250250
details::http_endpoint idx(resource, family, true, regex_checking);
251251

252252
pair<map<details::http_endpoint, details::http_resource_mirror>::iterator, bool> result = registered_resources.insert(
253-
pair<details::http_endpoint, details::http_resource_mirror>(idx, hrm)
253+
map<details::http_endpoint, details::http_resource_mirror>::value_type(idx, hrm)
254254
);
255255

256256
if(result.second)
@@ -1414,7 +1414,7 @@ void webserver::register_to_topics(
14141414
struct timeval curtime;
14151415
gettimeofday(&curtime, NULL);
14161416
q_keepalives[connection_id] = curtime.tv_sec;
1417-
q_keepalives_mem[connection_id] = make_pair<int, string>(
1417+
q_keepalives_mem[connection_id] = make_pair(
14181418
keepalive_secs, keepalive_msg
14191419
);
14201420
}
@@ -1425,7 +1425,7 @@ void webserver::register_to_topics(
14251425
pthread_mutex_init(&m, NULL);
14261426
pthread_cond_init(&c, NULL);
14271427
q_blocks[connection_id] =
1428-
std::make_pair<pthread_mutex_t, pthread_cond_t>(m, c);
1428+
std::make_pair(m, c);
14291429
}
14301430
pthread_rwlock_unlock(&comet_guard);
14311431
}

0 commit comments

Comments
 (0)