Using MacOS 15.6. I have installed dcc on mac using the installation script as recommended by dcc documentation. When using dcc in the terminal, I get an internal error due to the function 'gettid':
dcc about_me.c -o about_mee
dcc: Internal error
<stdin>:1290:86: error: call to undeclared function 'gettid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
snprintf(threadid_buffer, sizeof threadid_buffer, "DCC_SIGNAL_THREAD=%ld", (long)gettid());
^
1 error generated.
It looks like in wrapper_c/dcc_util.c, on line 254, there is a call to "(long)gettid());".
As far as my research shows, gettid is not a function on macOS, but a similar function is pthread_threadid_np().
Wondering if there is a workaround for me or any way that I can compile dcc with altered source code on my mac so that it uses the above function.
An idea for a long-term solution could be to have an #ifdef __APPLE__ pthread_threadid_np(); #else gettid() (pseudo-code).