konteck / wpp

Single file embedded C++ web server
http://konteck.github.com/wpp
94 stars 47 forks source link

doesn't work with libc++ #3

Closed gzmask closed 10 years ago

gzmask commented 11 years ago

clang++ -std=c++11 -stdlib=libc++ -o bin/run src/demo.cpp

src/web++.hpp:466:73: error: invalid operands to binary expression ('__bind<int &, sockaddr , unsigned long>' and 'int') if (bind(sc, (struct sockaddr ) &serv_addr, sizeof(serv_addr)) < 0) {


1 error generated.
gzmask commented 11 years ago

solution is pretty simply but im too lazy to make pull request: if (::bind(sc, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {

instead of

if (bind(sc, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {

gzmask commented 11 years ago

server.all("/dir", "./"); gives a blank page even after the fix. Something is not working with libc++ for sure.

alexk7 commented 10 years ago

works for me with the modification.

detro commented 10 years ago

I wonder if @konteck is stil supporting this project. I was considering integrating it into PhantomJS, but would be more valuable if actual development was still ongoing...

mmaraya commented 10 years ago

@gzmask, could you please see if commit 38c6e9e fixes the problem for you? Thanks.