문제

Is there a Preproccessor AND directive? If not how would you suggest I tackle the following task?

#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
도움이 되었습니까?

해결책

You can use defined like this:

#if defined(INSTALL_V8) && defined(INSTALL_V9) && defined(INSTALL_V10)

다른 팁

nest the conditions

#ifdef CONDITION1
# ifdef CONDITION2
# endif
#endif
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top