• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to count Atoms
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to count Atoms


  • Subject: Re: How to count Atoms
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 07 Oct 2016 03:43:44 -0500

On Oct 7, 2016, at 2:19 AM, Gerriet M. Denkmann <email@hidden> 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 (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to count Atoms
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >How to count Atoms (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: How to count Atoms
  • Next by Date: Re: progress bar not updating
  • Previous by thread: Re: How to count Atoms
  • Next by thread: Re: How to count Atoms
  • Index(es):
    • Date
    • Thread