valenok/mongoose — pull request #16 by dnaeon (2012-09-02 07:33:52+00:00)
Title: Fix building of mogoose under FreeBSD

* sys/socket.h should be included when building under FreeBSD

Currently when trying to build the examples under FreeBSD you get this error:

% make
OS=`uname`; test "$OS" = Linux && LIBS="-ldl" ; cc -W -Wall -I.. -pthread -g hello.c ../mongoose.c $LIBS -o hello;
../mongoose.c: In function 'mg_connect':
../mongoose.c:3988: error: 'PF_INET' undeclared (first use in this function)
../mongoose.c:3988: error: (Each undeclared identifier is reported only once
../mongoose.c:3988: error: for each function it appears in.)

The attached patch fixes this error for FreeBSD systems.