jeremycw / httpserver.h

Single header library for writing non-blocking HTTP servers in C
MIT License
1.78k stars 143 forks source link

Example not compiling #55

Open lindevel opened 3 years ago

lindevel commented 3 years ago
$ env LANG=C gcc q.c
In file included from q.c:2:
httpserver.h: In function 'http_listen':
httpserver.h:1223:40: error: 'SO_REUSEPORT' undeclared (first use in this function); did you mean 'SO_REUSEADDR'?
 1223 |   setsockopt(serv->socket, SOL_SOCKET, SO_REUSEPORT, &flag, sizeof(flag));
      |                                        ^~~~~~~~~~~~
      |                                        SO_REUSEADDR
httpserver.h:1223:40: note: each undeclared identifier is reported only once for each function it appears in

glibc: 2.33 gcc: 10.2.0 This https://github.com/jeremycw/httpserver.h/pull/43 PR resolves issue