● Top dumb issues
● Not linux or BSD? #include <windows.h>
can someone explain the above to me? the slides didn't make sense.
● Not linux or BSD? #include <windows.h>
can someone explain the above to me? the slides didn't make sense.
#ifdef LINUX
// include Linux headers
#elif defined(BSD)
// include BSD headers
#else
// include Windows headers. What else would it possibly be?
#endif
The "mach.h" one is similar: people make a bad assumption that OS X is the only Mach kernel people use. (Hurd is obviously a counterpoint, just an unpopular one.) #ifdef LINUX
// include Linux headers
#elif defined(BSD)
// include BSD headers
#elif defined(WINDOWS)
// include Windows headers.
# else
#error "unsupported system"
#endif