Got it to compile on MacOS. I had to split semaphore into Semaphore and NamedSemaphore classes like in boost. Semaphore is implemented with Grand Central Dispatch because sem_init returns not implemented error MacOS. NamedSemaphore uses the spin lock approach like in boost for sem_timedwait. sem_getvalue is also not supported on MacOS so I had to remove it, this is the only possible source of problems in this patch.
Note the change in MQTTSNSearchClient.c, there seems to be a bug: (gatewayaddress_len > 0) is always true, I assume it must be (*gatewayaddress_len > 0)
Got it to compile on MacOS. I had to split semaphore into Semaphore and NamedSemaphore classes like in boost. Semaphore is implemented with Grand Central Dispatch because sem_init returns not implemented error MacOS. NamedSemaphore uses the spin lock approach like in boost for sem_timedwait. sem_getvalue is also not supported on MacOS so I had to remove it, this is the only possible source of problems in this patch.
Note the change in MQTTSNSearchClient.c, there seems to be a bug: (gatewayaddress_len > 0) is always true, I assume it must be (*gatewayaddress_len > 0)