stef...@apache.org wrote on Sun, Apr 15, 2012 at 13:42:44 -0000:
> Author: stefan2
> Date: Sun Apr 15 13:42:44 2012
> New Revision: 1326337
> 
> URL: http://svn.apache.org/viewvc?rev=1326337&view=rev
> Log:
> Fix a macro redefinition warning for SYNCHRONIZE under Windows.
> 
> * subversion/libsvn_subr/svn_named_atomic.c
>   (SYNCHRONIZE): undefine pre-existing definitions
> 
> Modified:
>     subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
> 
> Modified: subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c?rev=1326337&r1=1326336&r2=1326337&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c Sun Apr 15 
> 13:42:44 2012
> @@ -88,6 +88,12 @@
>   */
>  #define SHM_NAME_SUFFIX "Shm"
>  
> +/* Prevent macro re-definition warning (on Windows in particluar).
> + */
> +#ifdef SYNCHRONIZE
> +#undef SYNCHRONIZE
> +#endif

Is this a safe change?  Experimenting shows that if later in the file
a macro is used which is defined in terms of SYNCHRONIZE, the file-local
definition (below the diff context) would be used even for macros
defined while the previous definition was effective.

Shouldn't you rename the macro?


> +
>  /* Platform-dependent implementations of our basic atomic operations.
>   * SYNCHRONIZE(op) will ensure that the OP gets executed atomically.
>   * This will be zero-overhead if OP itself is already atomic.
> 
> 

Reply via email to