Skip to content

Commit d213179

Browse files
committed
changes for build with new compiler
1 parent b816143 commit d213179

12 files changed

Lines changed: 30 additions & 36 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" MAT
4040
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wextra -Wshadow")
4141
endif ()
4242

43-
set(CMAKE_CXX_STANDARD 11)
43+
set(CMAKE_CXX_STANDARD 20)
4444
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4545
set(CMAKE_C_STANDARD 11)
4646

bins/broker/CMakeLists.txt

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,7 @@ set(SOURCE_FILES
118118
s2s_proto/S2SProto.h
119119
session/DBMSSession.cpp
120120
session/DBMSSession.h
121-
net/SocketReactor.cpp
122-
net/SocketReactor.h
123-
net/ParallelSocketReactor.h
124-
net/ParallelSocketAcceptor.h
125-
net/SocketNotifier.cpp
126-
net/SocketNotifier.h
127-
net/SocketNotification.cpp
128-
net/SocketNotification.h
129-
net/NotificationCenter.cpp
130-
net/NotificationCenter.h)
121+
)
131122

132123
if (ENABLE_WEB_ADMIN)
133124
add_definitions(-DENABLE_WEB_ADMIN)
@@ -236,11 +227,11 @@ else ()
236227
endif ()
237228
endif ()
238229

239-
target_link_libraries(broker PRIVATE upmq::protocol protobuf::libprotobuf ${CMAKE_DL_LIBS} ${POCO_LIBS})
230+
target_link_libraries(broker PRIVATE upmq::protocol ${CMAKE_DL_LIBS} ${POCO_LIBS})
240231
if (NOT WIN32)
241-
target_link_libraries(broker PRIVATE Threads::Threads)
232+
target_link_libraries(broker PRIVATE Threads::Threads -Wl,--copy-dt-needed-entries protobuf::libprotobuf)
242233
else ()
243-
target_link_libraries(broker PRIVATE ws2_32 mswsock iphlpapi)
234+
target_link_libraries(broker PRIVATE protobuf::libprotobuf ws2_32 mswsock iphlpapi)
244235
endif ()
245236

246237
macro(copy_poco_lib APP DLL)

bins/broker/destination/Destination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void Destination::subscribeOnNotify(Subscription &subscription) const {
196196
TRACE(log);
197197
{
198198
upmq::ScopedWriteRWLock writeRWLock(_routingLock);
199-
_routing.insert(std::make_pair(subscription.routingKey(), std::make_unique<Poco::FIFOEvent<const MessageDataContainer *>>()));
199+
_routing.insert(std::make_pair(subscription.routingKey(), std::make_unique<Poco::BasicEvent<const MessageDataContainer *>>()));
200200
*_routing[subscription.routingKey()] += Poco::delegate(&subscription, &Subscription::onEvent);
201201
}
202202
subscription.setHasNotify(true);

bins/broker/destination/Destination.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <Poco/Data/Session.h>
2424
#endif
2525

26-
#include <Poco/FIFOEvent.h>
26+
#include <Poco/BasicEvent.h>
2727
#include <Poco/Logger.h>
2828
#include <memory>
2929
#include <utility>
@@ -42,7 +42,7 @@ class Destination {
4242
/// @brief SubscriptionsList - map<subs-name, subs>
4343
using SubscriptionsList = FSUnorderedMap<std::string, Subscription>;
4444
/// @brief RoutingList - map<routingKey, message>
45-
using RoutingList = std::unordered_map<std::string, std::unique_ptr<Poco::FIFOEvent<const MessageDataContainer *>>>;
45+
using RoutingList = std::unordered_map<std::string, std::unique_ptr<Poco::BasicEvent<const MessageDataContainer *>>>;
4646
/// @brief NotAckConsumersInfoList - map<object_id, message_count>
4747
using NotAckConsumersInfoList = std::unordered_map<std::string, std::unique_ptr<std::atomic_int>>;
4848
/// @brief Session2SubscriptionMap - map<session_id, {subs-name}>

bins/broker/misc/FixedSizeUnorderedMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ class FSUnorderedMap {
274274
public:
275275
explicit FSUnorderedMap(size_t size) : _items(size), _size(size) {}
276276
FSUnorderedMap(FSUnorderedMap &&o) noexcept
277-
: _items(std::move(o._items)), _size(std::move(o._size)), _realSize(o._realSize.load()), _validIndexes(o._validIndexes) {}
277+
: _items(std::move(o._items)), _size(o._size), _realSize(o._realSize.load()), _validIndexes(o._validIndexes) {}
278278
FSReadLockedValue<Key, Value> find(const Key &key) const {
279279
size_t index = Poco::hash(key) % _size;
280280
return _items.at(index).find(key);
281281
}
282282
FSUnorderedMap &operator=(FSUnorderedMap &&o) noexcept {
283283
upmq::ScopedWriteRWLock thisRWLock(_validIndexesLock);
284284
_items = std::move(o._items);
285-
_size = std::move(o._size);
285+
_size = o._size;
286286
_realSize = o._realSize.load();
287287
_validIndexes = o._validIndexes;
288288
return *this;

bins/broker/net/ReactorHeaders.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef UPMQ_BINS_BROKER_NET_REACTORHEADERS_H_
66
#define UPMQ_BINS_BROKER_NET_REACTORHEADERS_H_
77

8-
#define UPMQ_REACTOR
8+
//#define UPMQ_REACTOR
99

1010
#ifdef UPMQ_REACTOR
1111
#include "SocketNotifier.h"

bins/broker/web/TemplateParamReplacer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <string>
2121
#include <map>
2222
#include <vector>
23+
#include <cstdint>
2324

2425
class TemplateParamReplacer {
2526
public:

libs/libupmq/decaf/internal/security/provider/crypto/SHA1MessageDigestSpi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class SHA1MessageDigestSpiImpl {
285285
memset(((unsigned char *)data) + index, 0, SHA_BLOCKSIZE - index);
286286
maybeReverseBytes(data, SHA_BLOCKSIZE);
287287
SHA1Transform(state, data);
288-
memset((unsigned char *)data, 0, SHA_BLOCKSIZE - 8 - index);
288+
memset((unsigned char *)data, 0, SHA_BLOCKSIZE - 8);
289289
} else {
290290
memset(((unsigned char *)data) + index, 0, SHA_BLOCKSIZE - 8 - index);
291291
}

libs/libupmq/decaf/lang/Pointer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class Pointer : public REFCOUNTER {
284284

285285
template <typename T1, typename R1>
286286
bool operator!=(const Pointer<T1, R1> &right) const {
287-
return !(this->value == right.get());
287+
return this->value != right.get();
288288
}
289289

290290
template <typename T1>
@@ -377,9 +377,9 @@ template <typename T>
377377
struct less<decaf::lang::Pointer<T> > { //: public binary_function<decaf::lang::Pointer<T>, decaf::lang::Pointer<T>,
378378
// bool> {
379379

380-
typedef decaf::lang::Pointer<T> first_argument_type;
381-
typedef decaf::lang::Pointer<T> second_argument_type;
382-
typedef bool result_type;
380+
using first_argument_type = decaf::lang::Pointer<T>;
381+
using second_argument_type = decaf::lang::Pointer<T>;
382+
using result_type = bool;
383383

384384
bool operator()(const decaf::lang::Pointer<T> &left, const decaf::lang::Pointer<T> &right) const { return less<T *>()(left.get(), right.get()); }
385385
};

libs/libupmq/decaf/lang/System.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <sys/types.h>
3939
#endif
4040
#ifdef HAVE_SYS_SYSCTL_H
41-
#include <sys/sysctl.h>
41+
//#include <sys/sysctl.h>
4242
#endif
4343
#ifdef HAVE_STRING_H
4444
#include <cstring>

0 commit comments

Comments
 (0)