Getting base name of the source file at compile time

后端 未结 14 2293
有刺的猬
有刺的猬 2020-12-14 10:07

I\'m using GCC; __FILE__ returns the current source file\'s entire path and name: /path/to/file.cpp. Is there a way to get just the file\'s name file.cpp<

14条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 10:35

    You could use:

    bool IsDebugBuild()
    {
        return !NDEBUG;
    }
    

    Or, you could use NDEBUG in your Macro to turn on/off those file paths.

提交回复
热议问题