mirror of
https://github.com/gelldur/EventBus.git
synced 2024-12-26 02:13:50 +08:00
Fixes for MSVC 2019
This commit is contained in:
parent
3238c41ea5
commit
4689564c4c
@ -79,8 +79,8 @@ set(CMAKE_CXX_FLAGS_UBSAN
|
||||
CACHE STRING "Flags used by the C++ compiler during UndefinedBehaviourSanitizer builds."
|
||||
FORCE)
|
||||
|
||||
add_subdirectory(lib/)
|
||||
add_subdirectory(use_case/)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(use_case)
|
||||
|
||||
if(ENABLE_TEST)
|
||||
enable_testing()
|
||||
@ -91,9 +91,11 @@ if(ENABLE_PERFORMANCE)
|
||||
add_subdirectory(performance/)
|
||||
endif()
|
||||
|
||||
target_compile_options(EventBus PRIVATE
|
||||
if(NOT MSVC)
|
||||
target_compile_options(EventBus PRIVATE
|
||||
-Wall -pedantic
|
||||
-Wnon-virtual-dtor
|
||||
-Werror
|
||||
-Wno-error=deprecated-declarations
|
||||
)
|
||||
endif()
|
@ -3,6 +3,8 @@
|
||||
//
|
||||
#include "EventBus.hpp"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace dexode
|
||||
{
|
||||
|
||||
@ -70,7 +72,7 @@ eventbus::stream::EventStream* EventBus::findStream(
|
||||
void EventBus::unlistenAll(const std::uint32_t listenerID)
|
||||
{
|
||||
std::shared_lock readGuard{_mutexStreams};
|
||||
for(auto& eventStream : _eventToStream)
|
||||
for(const auto& eventStream : _eventToStream)
|
||||
{
|
||||
eventStream.second->removeListener(listenerID);
|
||||
}
|
||||
@ -120,7 +122,7 @@ eventbus::stream::EventStream* EventBus::listen(const std::uint32_t,
|
||||
void EventBus::unlisten(const std::uint32_t listenerID,
|
||||
const eventbus::internal::event_id_t eventID)
|
||||
{
|
||||
auto* eventStream = findStream(eventID);
|
||||
eventbus::stream::EventStream* eventStream = findStream(eventID);
|
||||
if(eventStream != nullptr)
|
||||
{
|
||||
eventStream->removeListener(listenerID);
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <shared_mutex>
|
||||
#include <vector>
|
||||
|
||||
#include "dexode/eventbus/stream/EventStream.hpp"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user