On Oct 7, 2016, at 2:19 AM, Gerriet M. Denkmann <g...@mdenkmann.de> wrote:
> 
> I need (just for debugging purposes) to count something in a thread safe way. 
> […]
> So I tried OSIncrementAtomic.
> Now I get: "Implicit declaration of function 'OSIncrementAtomic' is invalid 
> in C99" and the linker fails, because it does not find it.
> #import <libkern/OSAtomic.h>  does not help at all.

These problems are all because you're using the wrong name.

If you #import <libkern/OSAtomic.h> then you get the declaration of 
OSAtomicIncrement32() (among other things).  Note this is not the name you 
tried (OSIncrementAtomic).  If you use the right name, the compiler warning and 
linker error will go away.

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to