mcpcpc / kirc

A tiny IRC client written in POSIX C99.
https://mcpcpc.github.io/kirc/
MIT License
521 stars 31 forks source link

Build errors on FreeBSD #97

Closed plasmoduck closed 3 years ago

plasmoduck commented 3 years ago

 kirc git:(master) make cc -O2 -pipe -c kirc.c kirc.c:426:22: error: use of undeclared identifier 'AF_UNSPEC' .ai_family = AF_UNSPEC, ^ kirc.c:427:24: error: use of undeclared identifier 'SOCK_STREAM' .ai_socktype = SOCK_STREAM ^ kirc.c:437:21: warning: implicit declaration of function 'socket' is invalid in C99 [-Wimplicit-function-declaration] if ((conn = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { ^ kirc.c:441:13: warning: implicit declaration of function 'connect' is invalid in C99 [-Wimplicit-function-declaration] if (connect(conn, p->ai_addr, p->ai_addrlen) == -1) { ^ 2 warnings and 2 errors generated. *** Error code 1

Stop. make: stopped in /usr/home/cjg/suckless/kirc

mcpcpc commented 3 years ago

Have not tested kirc on FreeBSD before but the fix seems pretty straight forward. From what i have read, types.h and socket.h need to be explicitly declared:

# include <sys/types.h>
# include <sys/socket.h>

I’ll try to get a FreeBSD VM up and running this week to verify.

plasmoduck commented 3 years ago

Awesome that worked. I'll close this. Thanks