-1

I would like to add compiler directives in the code to say, if we compile with mingw, then don't take this piece of code into consideration.

For example:

#ifdef _MINGW32_   //if this defined then don't compile the code
int x;
code....
#endif

Is it possible? How to do that?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
JohnDoe
  • 825
  • 1
  • 13
  • 31
  • possible duplicate of [Detect compiler with #ifdef](http://stackoverflow.com/questions/1233435/detect-compiler-with-ifdef) – user3419537 Sep 17 '15 at 12:45

1 Answers1

0

#ifndef, (or #if ! defined) does the opposite of #ifdef.

Community
  • 1
  • 1
Keith Marshall
  • 1,980
  • 15
  • 19