eddic / fastcgipp

fastcgi++: A C++ FastCGI and Web development platform:
https://fastcgipp.isatec.ca
GNU Lesser General Public License v3.0
310 stars 94 forks source link

Compile on OSX #73

Closed willzyba closed 5 years ago

willzyba commented 5 years ago

Thanks for a great library.

To get this to compile on OSX, can you add to the top of sockets.cpp

#ifndef POLLRDHUP
#define POLLRDHUP 0x2000
#endif

#ifndef MSG_NOSIGNAL
# define MSG_NOSIGNAL 0
# ifdef SO_NOSIGPIPE
#  define CEPH_USE_SO_NOSIGPIPE
# else
#  error "Cannot block SIGPIPE!"
# endif
#endif

And add to log.cpp:

#if __APPLE__
    #ifndef HOST_NAME_MAX
        #define HOST_NAME_MAX 255
    #endif

    #ifndef program_invocation_name
        #define program_invocation_name "fastcgi"
    #endif
#endif
chujiangke commented 5 years ago

well done man , macos complies success thanks

enhering commented 5 years ago

Thanks a lot! Now it works.

eddic commented 5 years ago

Submit this as a pull request and I'll apply it. Get your name on it.

enhering commented 4 years ago

I added both modifications, but now I'm getting:

Scanning dependencies of target fastcgipp
[  5%] Building CXX object CMakeFiles/fastcgipp.dir/src/log.cpp.o
[ 11%] Building CXX object CMakeFiles/fastcgipp.dir/src/block.cpp.o
[ 16%] Building CXX object CMakeFiles/fastcgipp.dir/src/http.cpp.o
[ 22%] Building CXX object CMakeFiles/fastcgipp.dir/src/protocol.cpp.o
[ 27%] Building CXX object CMakeFiles/fastcgipp.dir/src/poll.cpp.o
/Users/enhering/Documents/git/BEEGOL/bwma-infrastructure/dependencies/fastcgi++/src/poll.cpp:52:53: error: use of undeclared identifier 'POLLRDHUP'
const unsigned Fastcgipp::Poll::Result::pollRdHup = POLLRDHUP;
                                                    ^
/Users/enhering/Documents/git/BEEGOL/bwma-infrastructure/dependencies/fastcgi++/src/poll.cpp:133:37: error: use of undeclared identifier 'POLLRDHUP'
    m_poll.back().events = POLLIN | POLLRDHUP | POLLERR | POLLHUP;
enhering commented 4 years ago

@eddic , there is still a bug here. Does the error message above gives a clue to you on how to solve it?