From 15b57bd97232ba83a6a3aeebd033a2a3b87f158b Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Mon, 28 Nov 2022 17:18:33 +0000 Subject: [PATCH] fix: remove minor string view dependencies Signed-off-by: Jason Dellaluce --- tests/engine/test_falco_utils.cpp | 1 - userspace/engine/CMakeLists.txt | 2 -- userspace/engine/falco_utils.cpp | 3 ++- userspace/engine/falco_utils.h | 1 - userspace/falco/CMakeLists.txt | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/engine/test_falco_utils.cpp b/tests/engine/test_falco_utils.cpp index 628b790d..55da4b0d 100644 --- a/tests/engine/test_falco_utils.cpp +++ b/tests/engine/test_falco_utils.cpp @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "falco_utils.h" -#include #include TEST_CASE("is_unix_scheme matches", "[utils]") diff --git a/userspace/engine/CMakeLists.txt b/userspace/engine/CMakeLists.txt index f4a33351..74944c57 100644 --- a/userspace/engine/CMakeLists.txt +++ b/userspace/engine/CMakeLists.txt @@ -39,7 +39,6 @@ if(MINIMAL_BUILD) PUBLIC "${NJSON_INCLUDE}" "${TBB_INCLUDE_DIR}" - "${STRING_VIEW_LITE_INCLUDE}" "${LIBSCAP_INCLUDE_DIRS}" "${LIBSINSP_INCLUDE_DIRS}" "${YAMLCPP_INCLUDE_DIR}" @@ -50,7 +49,6 @@ else() PUBLIC "${NJSON_INCLUDE}" "${TBB_INCLUDE_DIR}" - "${STRING_VIEW_LITE_INCLUDE}" "${LIBSCAP_INCLUDE_DIRS}" "${LIBSINSP_INCLUDE_DIRS}" "${YAMLCPP_INCLUDE_DIR}" diff --git a/userspace/engine/falco_utils.cpp b/userspace/engine/falco_utils.cpp index 49b05a69..53e71e42 100644 --- a/userspace/engine/falco_utils.cpp +++ b/userspace/engine/falco_utils.cpp @@ -20,6 +20,7 @@ limitations under the License. #include #include "falco_utils.h" +#include "utils.h" #include "banned.h" // This raises a compilation error when certain functions are used namespace falco @@ -77,7 +78,7 @@ namespace network { bool is_unix_scheme(const std::string& url) { - return url.starts_with(UNIX_SCHEME); + return sinsp_utils::startswith(url, UNIX_SCHEME); } } // namespace network } // namespace utils diff --git a/userspace/engine/falco_utils.h b/userspace/engine/falco_utils.h index 1619863e..93cc33b9 100644 --- a/userspace/engine/falco_utils.h +++ b/userspace/engine/falco_utils.h @@ -24,7 +24,6 @@ limitations under the License. #include #include #include -#include #ifdef __GNUC__ #define likely(x) __builtin_expect(!!(x), 1) diff --git a/userspace/falco/CMakeLists.txt b/userspace/falco/CMakeLists.txt index 1de6658b..8db16d39 100644 --- a/userspace/falco/CMakeLists.txt +++ b/userspace/falco/CMakeLists.txt @@ -62,7 +62,6 @@ set( "${PROJECT_SOURCE_DIR}/userspace/engine" "${PROJECT_BINARY_DIR}/userspace/falco" "${PROJECT_BINARY_DIR}/driver/src" - "${STRING_VIEW_LITE_INCLUDE}" "${CXXOPTS_INCLUDE_DIR}" "${YAMLCPP_INCLUDE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}"