jketterl / owrx_connector

direct conection layer for openwebrx
GNU General Public License v3.0
21 stars 18 forks source link

Compile on MacOS #8

Closed nandub closed 4 years ago

nandub commented 4 years ago

On MacOS it fails to compile because MacOS doesn't define MSG_NOSIGNAL.

See error:

/opt/openwebrx/owrx_connector/rtl_connector.c:253:104: error: use of undeclared identifier 'MSG_NOSIGNAL'
                sent = send(client_sock, ringbuffer + read_pos * sample_size, available * sample_size, MSG_NOSIGNAL);
                                                                                                       ^
/opt/openwebrx/owrx_connector/rtl_connector.c:256:124: error: use of undeclared identifier 'MSG_NOSIGNAL'
                sent  = send(client_sock, ringbuffer + read_pos * sample_size, (ringbuffer_size - read_pos) * sample_size, MSG_NOSIGNAL);
                                                                                                                           ^
/opt/openwebrx/owrx_connector/rtl_connector.c:258:79: error: use of undeclared identifier 'MSG_NOSIGNAL'
                sent += send(client_sock, ringbuffer, read_pos * sample_size, MSG_NOSIGNAL);

This pull request fixes the error, the fix was taken from https://github.com/tschaffter/tinywebsockets/issues/1.

jketterl commented 4 years ago

MacOS isn't really the target platform for OpenWebRX, so there may be other issues down the line... it's been a while since I tried running the whole setup on my MacBook, mostly because it has seen better days and I moved on to other platforms.

Anyway, I don't mind changes in the way you're proposing, but would you mind moving it to a separate file? Something like compat.h or maybe shims.h. The file you added it to serves a different purpose, and I'm not even sure it's going to be around for long.

nandub commented 4 years ago

@jketterl thanks, I understand, but macos is the only OS I have, so far I have been able to compile most components except wsjtx and owrx_connector without this fix. I will let you know once I have tested.

I updated the pull request, I went with the shims.h name and pushed the changes.

jketterl commented 4 years ago

Somebody asked about building WSJT-X on Mac on the wsjt-devel Mailing List today: https://sourceforge.net/p/wsjt/mailman/message/37080234/

Seems to be coincidence to me, but should help anyway in case you haven't seen it. :slightly_smiling_face:

Good Luck!

nandub commented 4 years ago

@jketterl thanks.