Using #define to include another file in C++/C

后端 未结 4 1211
刺人心
刺人心 2020-12-15 20:57

I want to define a macro which includes another header file like so:

#define MY_MACRO (text) #include \"__FILE__##_inline.inl\"

So that whe

4条回答
  •  离开以前
    2020-12-15 21:18

    It's not possible to use #define to construct other preprocessor directives, unless you run the preprocessor twice.

    But in your case even running the preprocessor twice won't help because the #include must be a single string of the form "..." or <...>.

提交回复
热议问题