What if you want to use some specific OS or want to write different code for different platforms? What if you want to enable / disable some functions of your code?
Here is the preprocessor of both #ifdefs #defineand #endifs.
, , Windows Linux:
#ifdef WINDOWS
#include <something_windows_related.h>
#else
#include <posix.h>
#endif
OpenCL:
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
, .
#ifdef HAVE_OPENCL
bool InitOpenCL(void) {
}
#endif
, : .