Check whether function is declared with C preprocessor?

后端 未结 5 1448
醉梦人生
醉梦人生 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条回答
  •  Happy的楠姐
    2020-12-20 12:39

    If you look at tools like autoconf you will see that they go through many tests to determine what a computer has or doesn't have, to compile properly, then they set the correct #DEFINES.

    You may want to look at that model, and that tool if you are on some flavor of unix, as what you want to do isn't going to be possible, as others undoubtedly are pointing out.

提交回复
热议问题