Pregunta

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

¿Fue útil?

Solución

Try using #ifdef. For example:

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

Otros consejos

gcc on cygwin defines the macro __CYGWIN32__.

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top