difference between #if defined(WIN32) and #ifdef(WIN32)

后端 未结 3 2095
挽巷
挽巷 2020-12-22 16:50

I am compiling my program that will running on linux gcc 4.4.1 C99.

I was just putting my #defines in to separate the code that will be compiled on either windows o

3条回答
  •  臣服心动
    2020-12-22 17:44

    #ifdef FOO
    

    and

    #if defined(FOO)
    

    are the same,

    but to do several things at once, you can use defined, like

    #if defined(FOO) || defined(BAR)
    

提交回复
热议问题