-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?

Andrew T.
  • 4,637
  • 8
  • 40
  • 60
JohnDoe
  • 791
  • 11
  • 26
  • 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

You want the opposite of #ifdef ... #ifndef, (or #if ! defined); and this is such trivial, fundamental C coding, that it hardly deserves a place here.

Keith Marshall
  • 1,912
  • 13
  • 17