Frage

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

War es hilfreich?

Lösung

Try using #ifdef. For example:

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

Andere Tipps

gcc on cygwin defines the macro __CYGWIN32__.

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top