Skip to content

Commit 3cba2e9

Browse files
committed
"skip define check"
1 parent 711b463 commit 3cba2e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Header_File_constructor.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ void process_file(std::filesystem::path in_file, std::istream& in, std::ostream&
177177
std::string content_after_ifndef = line.substr(result.position() + result.length());
178178
//content_after_ifndef must be empty or end with "//"
179179
if(content_after_ifndef.empty() || content_after_ifndef.find("//") == 0) {
180-
if(define_map.find(define_name) != define_map.end()) {
180+
//if "skip define check" in content_after_ifndef, skip define check
181+
if(content_after_ifndef.find("skip define check") != std::string::npos) {
182+
out << line_begin_of_this_line << line << std::endl;
183+
}
184+
else if(define_map.find(define_name) != define_map.end()) {
181185
//skip this line and all lines until #endif
182186
while(std::getline(in, line)) {
183187
line_num++;

0 commit comments

Comments
 (0)