Review Board 1.7.16


asterisk/lock.h: Fix syntax errors for non-gcc OSX with 64-bit integers

Review Request #4436 - Created Feb. 19, 2015 and submitted

Corey Farrell
11, 13, trunk
ASTERISK-24814
Reviewers
asterisk-dev
Asterisk
asterisk/lock.h: Add a couple of missing closing brackets / parenthesis.
Looked at the source.  I don't know what compiler would match the #if conditions.

Diff revision 1 (Latest)

  1. /branches/11/include/asterisk/lock.h: Loading...
/branches/11/include/asterisk/lock.h
Revision 431994 New Change
[20] 574 lines
[+20] [+] AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
575
})
575
})
576
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
576
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
577
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
577
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
578
{
578
{
579
	return OSAtomicAdd64(v, (int64_t *) p) - v;
579
	return OSAtomicAdd64(v, (int64_t *) p) - v;

    
   
580
})
580
#elif defined (__i386__) || defined(__x86_64__)
581
#elif defined (__i386__) || defined(__x86_64__)
581
#ifdef sun
582
#ifdef sun
582
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
583
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
583
{
584
{
584
	__asm __volatile (
585
	__asm __volatile (
[+20] [20] 36 lines
[+20] [+] AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
621
})
622
})
622
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
623
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
623
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
624
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
624
{
625
{
625
	return OSAtomicAdd64( -1, (int64_t *) p) == 0;
626
	return OSAtomicAdd64( -1, (int64_t *) p) == 0;

    
   
627
})
626
#else
628
#else
627
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
629
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
628
{
630
{
629
	int a = ast_atomic_fetchadd_int(p, -1);
631
	int a = ast_atomic_fetchadd_int(p, -1);
630
	return a == 1; /* true if the value is 0 now (so it was 1 previously) */
632
	return a == 1; /* true if the value is 0 now (so it was 1 previously) */
631
})
633
})
632
#endif
634
#endif
633

    
   
635

   
634
#endif /* _ASTERISK_LOCK_H */
636
#endif /* _ASTERISK_LOCK_H */
  1. /branches/11/include/asterisk/lock.h: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.