Daniel Shahaf wrote:
>>  URL: http://svn.apache.org/r1663760
[...]
>>  -#define svn_hash_sets(ht, key, val) \
>>  -            apr_hash_set(ht, key, APR_HASH_KEY_STRING, val)
>>  +#define svn_hash_sets(ht, key, val)     \
>>  +  do { [...] } while (0)
> 
> Strictly speaking, that's a backwards-incompatible change.  Since the
> new definition is no longer an rvalue, API consumers' code would break
> if they used svn_hash_sets() as part of a statement.  Example:
> 
>     /* This works with svn 1.8. */
>     #include <subversion-1/svn_hash.h>
>     #define my_foo() (svn_hash_sets(h, s), 42)
> 
> I think we have to either errata this, or restore svn_hash_gets()'
> previous definition and name the do-while version svn_hash_gets2().
> 
> Makes sense?

Yes... but a nicer solution would be to define it the same way as I defined 
*get* (forward through a private function), wouldn't it? That would restore a 
symmetry that Brane pointed out was surprisingly missing.

r1663896.

- Julian

Reply via email to