gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_SSL_MBEDTLS -I../mbedtls/include -c -o pcompat.o pcompat.c
pcompat.c: In function 'connect_socket_direct':
pcompat.c:1405:22: error: 'IPPROTO_TCP' undeclared (first use in this function)
1405 | setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&sock_opt, sizeof(sock_opt));
| ^~~~~~~~~~~
pcompat.c:1406:35: error: 'TCP_KEEPALIVE' undeclared (first use in this function); did you mean 'SO_KEEPALIVE'?
1406 | setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, (char*)&sock_opt, sizeof(sock_opt));
| ^~~~~~~~~~~~~
| SO_KEEPALIVE
After applying the fixes from Possible solutions section below, I get
In file included from psynclib.c:32:
pcallbacks.h:36:33: error: expected ')' before '*' token
36 | typedef void(/*_cdecl*/__stdcall *data_event_callback)(int eventId, char* str1, char* str2, uint64_t uint1, uint64_t uint2);
| ^~
| )
psynclib.c:2689:33: error: 'DELIM_DIR' undeclared (first use in this function)
2689 | parse_os_path(path, &folders, DELIM_DIR, 1);
| ^~~~~~~~~
Issue description
Does not compile under FreeBSD.
Errors
After applying the fixes from Possible solutions section below, I get
Steps to reproduce the issue
Possible solutions
I read somewhere that
So adding the following include to the
pcompat.c
file solved the problem with the undefinedIPPROTO_TCP
TCP_KEEPALIVE
I am not sure about, but I also read somewhere that maybe it should beTCP_KEEPIDLE
on FreeBSDFor the errors 3. and 4. I did not come up with a solution yet. So hopefully someone can help.
Environment