WAFer
WAFer copied to clipboard
Building on OS X fails
On OS X, building nope.c fails for me with:
> make
gcc -W -Wall -O2 -c -o nope.o nope.c
nope.c:13:10: fatal error: 'sys/sendfile.h' file not found
#include <sys/sendfile.h>
^
1 error generated.
make: *** [nope.o] Error 1
gcc --version output:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
See http://stackoverflow.com/questions/8252698/sys-sendfile-h-not-found-gcc
So it won't work on OS X without rewriting? That's a shame. You could check for #ifdef __APPLE__ though. The thing is, it doesn't say anywhere that it only works on Linux. So it probably doesn't work on Windows either, I guess?
read and write is more portable. #ifdef just adds more complexity.