Skip to content

Commit

Permalink
Fix compilation of library (not tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Feb 4, 2025
1 parent 868cc8e commit f43dbf0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/builder/ruleset_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
#include "exclusion/rule_filter.hpp"
#include "indexer.hpp"
#include "log.hpp"
#include "matcher/base.hpp"
#include "processor/base.hpp"
#include "rule.hpp"
#include "ruleset.hpp"
#include "ruleset_builder.hpp"
#include "scanner.hpp"

namespace ddwaf {

Expand Down Expand Up @@ -124,8 +128,8 @@ std::shared_ptr<ruleset> ruleset_builder::build(

if (contains(current_changes, base_rule_update | custom_rule_update)) {
rule_index_.clear();
for (const auto &rule : *final_base_rules_) { rule_index_.emplace(&rule); }
for (const auto &rule : *final_user_rules_) { rule_index_.emplace(&rule); }
for (auto &rule : *final_base_rules_) { rule_index_.emplace(&rule); }
for (auto &rule : *final_user_rules_) { rule_index_.emplace(&rule); }
}

// Generate rule filters targetting all final rules
Expand Down
1 change: 0 additions & 1 deletion src/condition/scalar_condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <span>
#include <string>
#include <string_view>
#include <unordered_map>
#include <utility>

#include "clock.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/exclusion/input_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <set>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>

#include "clock.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/exclusion/rule_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <set>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>

#include "clock.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Copyright 2021 Datadog, Inc.

#include <memory>
#include <string>
#include <unordered_map>

#include "clock.hpp"
#include "condition/base.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/indexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace ddwaf {

template <typename T> class indexer {
public:
using iterator = typename std::unordered_map<std::string_view, T>::iterator;
using const_iterator = typename std::unordered_map<std::string_view, T>::const_iterator;
using iterator = typename std::unordered_map<std::string_view, T *>::iterator;
using const_iterator = typename std::unordered_map<std::string_view, T *>::const_iterator;

void emplace(T *item)
{
Expand Down

0 comments on commit f43dbf0

Please sign in to comment.