WAFer icon indicating copy to clipboard operation
WAFer copied to clipboard

Building on OS X fails

Open omnidan opened this issue 11 years ago • 3 comments

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

omnidan avatar Jul 26 '14 17:07 omnidan

See http://stackoverflow.com/questions/8252698/sys-sendfile-h-not-found-gcc

sternenseemann avatar Jul 27 '14 10:07 sternenseemann

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?

omnidan avatar Jul 27 '14 13:07 omnidan

read and write is more portable. #ifdef just adds more complexity.

gsquire avatar Jul 30 '14 03:07 gsquire