[LAD] Atomic Operations
Tim Goetze
tim at quitte.de
Thu Dec 17 15:00:17 UTC 2009
[Olivier Guilyardi]
>On 12/17/2009 01:03 PM, Tim Blechmann wrote:
>>> +#if defined(__APPLE__)
>>> +#include <libkern/OSAtomic.h>
>>> +#define MEMORY_BARRIER() OSMemoryBarrier()
>>> +#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
>>> +#define MEMORY_BARRIER() __sync_synchronize()
>>> +#else
>>> +#warning SMP Danger: memory barriers are not supported on this system
>>> +#endif
I may be wrong but if neither __APPLE__ nor __GNUC__ >= 4.1 are true
shouldn't MEMORY_BARRIER() at least be an empty define to keep cpp
happy?
After all, your #warning statement seems to indicate you don't want
compilation to fail.
Cheers, Tim
More information about the Linux-audio-dev
mailing list