From 025913a7342c085c246b471aa884749773cc04e5 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 5 Apr 2023 13:27:46 -0400 Subject: [PATCH] Fix string_view constructor for macOS clang Some versions of clang 14 (macOS+android) don't implement `string_view(It first, It last)`, so let's use `string_view(const CharT*, size_type)` instead. Also remove unused header leftover from old code that uses std::string. --- src/core/gdbstub/hio.cpp | 4 ++-- src/core/gdbstub/hio.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/gdbstub/hio.cpp b/src/core/gdbstub/hio.cpp index 02d149b0f..ac085d5b7 100644 --- a/src/core/gdbstub/hio.cpp +++ b/src/core/gdbstub/hio.cpp @@ -81,8 +81,8 @@ void SetHioRequest(const VAddr addr) { if (current_hio_request.magic != std::array{'G', 'D', 'B', '\0'}) { std::string_view bad_magic{ - std::begin(current_hio_request.magic), - std::end(current_hio_request.magic), + current_hio_request.magic.data(), + current_hio_request.magic.size(), }; LOG_WARNING(Debug_GDBStub, "Invalid HIO request sent by application: bad magic '{}'", bad_magic); diff --git a/src/core/gdbstub/hio.h b/src/core/gdbstub/hio.h index f85f1e7dc..d498a2737 100644 --- a/src/core/gdbstub/hio.h +++ b/src/core/gdbstub/hio.h @@ -4,8 +4,6 @@ #pragma once -#include - #include "common/common_types.h" namespace GDBStub {