diff --git a/main.cpp b/main.cpp index b1f67b1..fb65a42 100644 --- a/main.cpp +++ b/main.cpp @@ -123,6 +123,15 @@ std::vector getIncludes(std::string filename) char *p = buffer; while (*p != 0) { + // Ignore commented lines + if ( (*p=='/') && (*(p+1)!=0) && (*(p+1)=='/')) while( (*p != 0) && (*p != 13) ) p++; + + // Ignore comment blocks + if ( (*p=='/') && (*(p+1)!=0) && (*(p+1)=='*')) { + p+=2; + while( (*p != 0) && (*p != '*') && (*(p+1)!=0) && (*(p+1)!='/') ) p++; + } + if (*p=='#') { if (textFound(buffer, "#include"))