riolet / WAFer

WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers.
GNU General Public License v2.0
694 stars 69 forks source link

Building on OS X fails #20

Open omnidan opened 10 years ago

omnidan commented 10 years ago

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
sternenseemann commented 10 years ago

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

omnidan commented 10 years ago

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?

gsquire commented 10 years ago

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