How to stringify a string which contains a comma?

前端 未结 2 898
生来不讨喜
生来不讨喜 2021-02-10 01:15

I want to pass a version string in the compile command:

$ g++ -Wall -D VERSION=\"2013-12-03 02:15:21, commit cb060df\" -o          


        
2条回答
  •  后悔当初
    2021-02-10 01:51

    __VA_ARGS__ must be in each call:

    #define _STRINGIZE(...) #__VA_ARGS__
    #define STRINGIZE(...) _STRINGIZE(__VA_ARGS__)
    

提交回复
热议问题