From b1f93cfc72b9a81d325704fa02f9ade1a11993fa Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 1 Feb 2024 13:32:31 +0800 Subject: [PATCH] fix compile error in msvc --- src/error.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index b6492209..21a80b9e 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -5,10 +5,10 @@ namespace pkpy{ SourceData::SourceData(std::string_view source, const Str& filename, CompileMode mode): filename(filename), mode(mode) { int index = 0; // Skip utf8 BOM if there is any. - if (strncmp(source.begin(), "\xEF\xBB\xBF", 3) == 0) index += 3; + if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3; // Drop all '\r' SStream ss; - while(index < source.length()){ + while(index < source.size()){ if(source[index] != '\r') ss << source[index]; index++; }