News for hackers. Stuff that matters.
Re:Debian GNU/Hurd Status Update [pdf] by jasonoliveira on Tuesday August 25, 2015 @03:52PM (#10119050)
● Top dumb issues

● Not linux or BSD? #include <windows.h>

can someone explain the above to me? the slides didn't make sense.

Re:Debian GNU/Hurd Status Update [pdf] by koenigdavidmj on Tuesday August 25, 2015 @04:02PM (#10119092)
Poorly written preprocessor bits in C code that assume that anything anyone ever runs is either Linux, BSD (including OS X), or Windows. They basically write the following:

  #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.)
Re:Debian GNU/Hurd Status Update [pdf] by ianremsen on Tuesday August 25, 2015 @06:24PM (#10119849)
I think it's wrong to call it poorly written because the programmer only accounted their C preprocessor code for ~99.99% of desktop and mobile operating systems. The diminishing return for avoiding this approach is so impalpable it hurts. Windows, OSX/iOS/BSD, and Linux/Android literally are everything anyone ever uses, within rounding error.
Re:Debian GNU/Hurd Status Update [pdf] by ori_b on Tuesday August 25, 2015 @06:41PM (#10119907)
The diminishing return approach is this:

     #ifdef LINUX
     // include Linux headers
     #elif defined(BSD)
     // include BSD headers
     #elif defined(WINDOWS)
     // include Windows headers.
     # else
     #error "unsupported system"
     #endif
Re:Debian GNU/Hurd Status Update [pdf] by viraptor on Tuesday August 25, 2015 @06:42PM (#10119913)
If you develop for different platforms then it may actually make sense to do a "if linux / elif bsd / elif windows / else #error unsupported". At least it gives you a proper answer in case you forgot you have some wild crosscompiler in your path. But I understand it's not a popular concern...