我試圖用coan,產生一個乾淨版本的代碼庫,但它creashes上的第一個定義的第一源代碼精細,使用:科恩給出了「擴展到表達式中沒有」與定義的符號
coan source -DNON_SMS --filter c,h --recurse --replace test -V
我得到:
coan: progress 0x00101: Processing file (1)
"D:\Documents\Downloads\test\cli.c"
coan: D:\Documents\Downloads\test\cli.c: line 53: error 0x00816: "NON_SMS" expands to nothing within expression, in "#if (NON_SMS) /* Non-SMS compile */"
coan: progress 0x02101: Completed with errors, exit code 0x04
coan: info 0x02201: 1 out of 41 input files were reached; 40 files were not reached
coan: info 0x02202: 0 out of 1 files reached were valid; 1 were abandoned due to parse errors
但代碼上正常工作MSVS及本聲明其實很簡單:
#if (NON_SMS) /* Non-SMS compile */
#include <stdlib.h> /* Standard library definitions */
#include <string.h> /* String related definitions */
#else
這是在Windows 7 x64上。
這是C還是C++?語言之間有區別。例如,C++有'std :: string',而C沒有。在C中,我可以有一個名爲「class」的變量。相應地調整你的標籤。 –
@ThomasMatthews這是既適用於C和C++作爲coan過程都具有相同的接口。 – canesin
嘗試使用'-DNON_SMS = 1'或'-DNON_SMS = 0'。代碼正在檢查值,而不僅僅是它是否被定義。 – Barmar