0

有预处理AND指令吗?如果不是,您建议我如何处理以下任务?

#define INSTALL_V8
#define INSTALL_V9
#define INSTALL_V10  // Using preprocessor directives and not static variables to
// avoid packaging unnecessary code into the application/installer

#ifdef INSTALL_V8 AND INSTALL_V9 AND INSTALL_V10
  #define CHECK_BOX_STRT_Y 60 // move the start y up so we have room to fit 3 checkboxes in the window
#else
  #define CHECK_BOX_STRT_Y 80 // place 1st checkbox in middle of window
#endif
4

2 回答 2

10

你可以defined这样使用:

#if defined(INSTALL_V8) && defined(INSTALL_V9) && defined(INSTALL_V10)
于 2013-08-21T05:00:31.533 回答
4

嵌套条件

#ifdef CONDITION1
# ifdef CONDITION2
# endif
#endif
于 2013-08-21T05:00:53.093 回答