Check whether function is declared with C preprocessor?

后端 未结 5 1475
醉梦人生
醉梦人生 2020-12-20 12:31

Is it possible to tell the C preprocessor to check whether a function (not a macro) is declared? I tried the following, but it doesn\'t appear to work:

5条回答
  •  孤城傲影
    2020-12-20 12:40

    The preprocessor is a simple program and knows next to nothing about the underlying language. It cannot tell if a function has been declared. Even if it could, the function may be defined in another library and the symbol is resolved during linking, so the preprocessor could not help in that regard.

提交回复
热议问题