简体   繁体   中英

Wrapping a line of preprocessor C++

How to wrap a line of preprocessor directive and ignore extra space?

Test Code:

    #error Line0\
    Line 1

Result:

short_test.cpp(1): error: #error directive: Line0    Line 1
      #error Line0\
       ^

While I want to keep the indent pattern in the test code, I don't want the spacing between line0 and line1 in the result.

Is that possible?

Result that I want:

short_test.cpp(1): error: #error directive: Line0Line 1
no space between Line0 and Line1

Test Code that I want

    #error Line0\
    (extra stuff?) Line 1  <-- keep the indent, ok to insert some extra stuff.

You can't, sorry.

The preprocessor will take precisely what you give it, including any indentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM