Dave's Brain

Browse - programming tips - most useful predefined macros

Date: 2010apr5

Q.  What a are the most useful predefined macros?

A.  For me, these are:

#ifdef _WIN16 || _WIN32 || _WIN64
// Windows
#else
// Non-Windows (eg Unix)
#fi

#ifdef __BORLANDC__
// Borland C++ specific stuff
#endif

#ifdef _MSC_VER
// Microsoft Visual C++ specific stuff
#endif

#ifdef __GNUC__
// Using gcc (probably Linux)
#endif

#ifdef _MFC_VER
// This only works with MFC (Microsoft Foundation Class)
#endif

#ifdef __cplusplus
// Make some classes
#endif
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2010, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.