TLeconte / vdlm2dec

vdl mode 2 SDR decoder
GNU General Public License v2.0
71 stars 23 forks source link

macOS/Darwin does not implement pthread barriers #35

Closed zrrVAQb0ae closed 5 years ago

zrrVAQb0ae commented 5 years ago

Not sure how high priority this is, but unlike acarsdec, vdlm2dec doesn't compile without modification since macOS Darwin doesn't implement POSIX thread barriers. There seem to be projects out there that have implemented this functionality easily themselves to avoid this compatibility issue, and thought it might be great if new users could just compile without problems.

This project for instance implemented pthread barriers to fix the compatibility issue: https://github.com/pmwkaa/ioarena/issues/10

Another example implementation: https://github.com/ademakov/DarwinPthreadBarrier

References to pthread_barrier_t:

vdlm2.h:88:8: extern pthread_barrier_t Bar1, Bar2;

main.c:187:2: pthread_barrier_init(&bar1, NULL, nbch + 1);

main.c:188:24: pthread_barrier_init(&Bar2, NULL, nbch + 1);

Also noticed that the build throws an error on the use of the undeclared identifier "HOST_NAME_MAX"

main.c:98:27: error: use of undeclared identifier 'HOST_NAME_MAX' char sys_hostname[HOST_NAME_MAX+1];

TLeconte commented 5 years ago

Now that vdlm2dec use cmake, I must easier to compile it with an external already installed lib. Just modify CMakeListes.txt (see LIBACARS example). As I don't have a Mac I could not do or test that. Sorry