Skip to content

Commit 235e094

Browse files
committed
fixed #476 - fixed MSYS2 compilation with MSYS msystem
1 parent a0b3f52 commit 235e094

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

simplecpp.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,12 +2385,17 @@ namespace simplecpp {
23852385
namespace simplecpp {
23862386

23872387
#ifdef __CYGWIN__
2388+
static bool startsWith(const std::string &s, const std::string &p)
2389+
{
2390+
return (s.size() >= p.size()) && std::equal(p.begin(), p.end(), s.begin());
2391+
}
2392+
23882393
std::string convertCygwinToWindowsPath(const std::string &cygwinPath)
23892394
{
23902395
std::string windowsPath;
23912396

23922397
std::string::size_type pos = 0;
2393-
if (cygwinPath.size() >= 11 && startsWith_(cygwinPath, "/cygdrive/")) {
2398+
if (cygwinPath.size() >= 11 && startsWith(cygwinPath, "/cygdrive/")) {
23942399
const unsigned char driveLetter = cygwinPath[10];
23952400
if (std::isalpha(driveLetter)) {
23962401
if (cygwinPath.size() == 11) {

0 commit comments

Comments
 (0)