You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ak...@apache.org on 2004/09/20 21:20:13 UTC

cvs commit: apr/atomic/win32 apr_atomic.c

ake         2004/09/20 12:20:12

  Modified:    atomic/win32 apr_atomic.c
  Log:
  WIN64: avoid unresolved external error with 64 bit build
  
  Revision  Changes    Path
  1.5       +8 -0      apr/atomic/win32/apr_atomic.c
  
  Index: apr_atomic.c
  ===================================================================
  RCS file: /home/cvs/apr/atomic/win32/apr_atomic.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apr_atomic.c	16 Apr 2004 13:54:19 -0000	1.4
  +++ apr_atomic.c	20 Sep 2004 19:20:12 -0000	1.5
  @@ -40,7 +40,11 @@
   
   APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
   {
  +#if (defined(_M_IA64) || defined(_M_AMD64))
  +    return InterlockedExchangeAdd(mem, val);
  +#else
       return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val);
  +#endif
   }
   
   /* Of course we want the 2's compliment of the unsigned value, val */
  @@ -48,7 +52,11 @@
   
   APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
   {
  +#if (defined(_M_IA64) || defined(_M_AMD64))
  +    InterlockedExchangeAdd(mem, -val);
  +#else
       ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val);
  +#endif
   }
   
   APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem)
  
  
  

Re: cvs commit: apr/atomic/win32 apr_atomic.c

Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 20 Sep 2004 ake@apache.org wrote:

> ake         2004/09/20 12:20:12
>
>   Modified:    atomic/win32 apr_atomic.c
>   Log:
>   WIN64: avoid unresolved external error with 64 bit build

>    {
>   +#if (defined(_M_IA64) || defined(_M_AMD64))
>   +    return InterlockedExchangeAdd(mem, val);
>   +#else
>        return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val);
>   +#endif
>    }


Doesn't this just mean that the definition of apr_atomic_win32_ptr_val_fn
is wrong on win64?  Wouldn't it be cleaner to redefine that on win64
instead of these two #if #else cases?

--Cliff