mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
AP_Common: uniqify semaphore names
This commit is contained in:
parent
e6a1789df8
commit
649130adcb
@ -48,5 +48,7 @@ private:
|
||||
AP_HAL::Semaphore &_mtx;
|
||||
};
|
||||
|
||||
#define WITH_SEMAPHORE(sem) WithSemaphore _getsem ## __UNIQ__(sem)
|
||||
|
||||
// From: https://stackoverflow.com/questions/19666142/why-is-a-level-of-indirection-needed-for-this-concatenation-macro
|
||||
#define WITH_SEMAPHORE( sem ) JOIN( sem, __COUNTER__ )
|
||||
#define JOIN( symbol1, symbol2 ) _DO_JOIN( symbol1, symbol2 )
|
||||
#define _DO_JOIN( symbol1, symbol2 ) WithSemaphore _getsem ## symbol2(symbol1)
|
||||
|
Loading…
Reference in New Issue
Block a user