Issue description
Does not compile under FreeBSD.
Errors
-
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);
| ^~~~~~~~~
Steps to reproduce the issue
$ pkg install git cmake gmake gcc lzlib boost-libs libpthread-stubs
$ git clone https://github.com/pcloudcom/console-client.git ./console-client/
$ cd ./console-client/pCloudCC/
$ cd lib/pclsync/
$ gmake clean
$ gmake fs
Possible solutions
-
I read somewhere that
IPPROTO_TCP is defined in netinet/in.h by the POSIX standard.
So adding the following include to the pcompat.c file solved the problem with the undefined IPPROTO_TCP
-
The undefined TCP_KEEPALIVE I am not sure about, but I also read somewhere that maybe it should be TCP_KEEPIDLE on FreeBSD
For the errors 3. and 4. I did not come up with a solution yet. So hopefully someone can help.
Environment
- OS: FreeBSD12.2-RELEASE-p10 (inside an iocage jail on a TrueNAS host machine)
- gcc (FreeBSD Ports Collection) 10.3.0
- cmake version 3.22.1
- gmake: GNU Make 4.3 Built for amd64-portbld-freebsd12.2
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.cfile solved the problem with the undefinedIPPROTO_TCPThe undefined
TCP_KEEPALIVEI am not sure about, but I also read somewhere that maybe it should beTCP_KEEPIDLEon FreeBSDFor the errors 3. and 4. I did not come up with a solution yet. So hopefully someone can help.
Environment