문제

I was trying to detect target operating system using c macros _WIN32 and _ CYGWIN_ but it shows error that _ CYGWIN_ is undeclared. How to use these macros to find target operating system

도움이 되었습니까?

해결책

Try using #ifdef. For example:

#ifdef __CYGWIN__
  // Cygwin specific code
#else
  // Other code
#endif

다른 팁

gcc on cygwin defines the macro __CYGWIN32__.

Take a look at GCC dump preprocessor defines to find all the macros defined by the preprocessor.

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