You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marcus Rueckert <da...@web.de> on 2005/05/12 18:45:06 UTC

[Patch] adding macro to check for a specific major/minor

hi

this is a little macro i found in the apache source.
i used it in [1] already and it works nicely.
Justin Erenkrantz from the apache folks said it would be ok to use it in
subversion.

[[[
Index: subversion/include/svn_version.h
===================================================================
--- subversion/include/svn_version.h    (revision 14707)
+++ subversion/include/svn_version.h    (working copy)
@@ -238,6 +238,13 @@
  */
   const svn_version_t *svn_subr_version (void);

    +/* little macro borrowed from the apache source code.
    + * Allows to check for a specific svn version.
    + */
    +#define SVN_VER_AT_LEAST(major,minor)       \
    +    ((major) < SVN_VER_MAJOR                \
    +        || ((major) == SVN_VER_MAJOR        \
    +            && (minor) <= SVN_VER_MINOR))

      #ifdef __cplusplus
]]]

darix

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Patch] adding macro to check for a specific major/minor

Posted by Marcus Rueckert <da...@web.de>.
hi

i forgot to mention 2 things:

usage
[[[
#if !SVN_VER_AT_LEAST(1, 2)
#error You need at least subversion 1.2 for using mod_authn_svn.
#endif
]]]

and yes i know it is a bit late for 1.2. i just forgot it in mod_authn_svn.c.
so just dump it into trunk so we have that at least.

darix


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Patch] adding macro to check for a specific major/minor

Posted by Max Bowsher <ma...@ukf.net>.
Marcus Rueckert wrote:
>> Given the nature of our compatibility policies, I'm not entirely 
>> convinced
>> this macro is going to be useful.
>>
>> What are we going to do when we hit 2.0? Will all our numerically 
>> suffixed
>> symbols revert to their plain forms?
>> If so, then the above macro simply won't be useful to people.
>
> max ... why is it useful for the apache folks?

I don't know. I'm not well versed in Apache compat standards. I do know that 
they are different from Subversion's, because if they were the same, Apache 
couldn't adopt APR 1.x until Apache 3.x.

> i think it makes the work for users of the svn api much easier.

How is it easier than a simple "SVN_VER_MINOR >= X" ?

And if someone really did want to support multiple Subversion major 
versions, wouldn't the appropriate test be:

SVN_VER_MAJOR == X && SVN_VER_MINOR >= Y

?


Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Patch] adding macro to check for a specific major/minor

Posted by Marcus Rueckert <da...@web.de>.
> Given the nature of our compatibility policies, I'm not entirely convinced 
> this macro is going to be useful.
> 
> What are we going to do when we hit 2.0? Will all our numerically suffixed 
> symbols revert to their plain forms?
> If so, then the above macro simply won't be useful to people.

max ... why is it useful for the apache folks?
i think it makes the work for users of the svn api much easier.

darix


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Patch] adding macro to check for a specific major/minor

Posted by Max Bowsher <ma...@ukf.net>.
Michael W Thelen wrote:
> Marcus Rueckert wrote:
>> this is a little macro i found in the apache source.
>> i used it in [1] already and it works nicely.
>> Justin Erenkrantz from the apache folks said it would be ok to use it in
>> subversion.
>>
>> [[[
>> Index: subversion/include/svn_version.h
>> ===================================================================
>> --- subversion/include/svn_version.h    (revision 14707)
>> +++ subversion/include/svn_version.h    (working copy)
>> @@ -238,6 +238,13 @@
>>   */
>>    const svn_version_t *svn_subr_version (void);
>>
>>     +/* little macro borrowed from the apache source code.
>>     + * Allows to check for a specific svn version.
>>     + */
>>     +#define SVN_VER_AT_LEAST(major,minor)       \
>>     +    ((major) < SVN_VER_MAJOR                \
>>     +        || ((major) == SVN_VER_MAJOR        \
>>     +            && (minor) <= SVN_VER_MINOR))
>>
>>       #ifdef __cplusplus
>> ]]]
>
> Is there any developer willing to review this patch in the next day or
> two?  If not, I'll file an issue for it.

Given the nature of our compatibility policies, I'm not entirely convinced 
this macro is going to be useful.

What are we going to do when we hit 2.0? Will all our numerically suffixed 
symbols revert to their plain forms?
If so, then the above macro simply won't be useful to people.

Max.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Patch] adding macro to check for a specific major/minor

Posted by Michael W Thelen <mi...@pietdepsi.com>.
Marcus Rueckert wrote:
> this is a little macro i found in the apache source.
> i used it in [1] already and it works nicely.
> Justin Erenkrantz from the apache folks said it would be ok to use it in
> subversion.
> 
> [[[
> Index: subversion/include/svn_version.h
> ===================================================================
> --- subversion/include/svn_version.h    (revision 14707)
> +++ subversion/include/svn_version.h    (working copy)
> @@ -238,6 +238,13 @@
>   */
>    const svn_version_t *svn_subr_version (void);
> 
>     +/* little macro borrowed from the apache source code.
>     + * Allows to check for a specific svn version.
>     + */
>     +#define SVN_VER_AT_LEAST(major,minor)       \
>     +    ((major) < SVN_VER_MAJOR                \
>     +        || ((major) == SVN_VER_MAJOR        \
>     +            && (minor) <= SVN_VER_MINOR))
> 
>       #ifdef __cplusplus
> ]]]

Is there any developer willing to review this patch in the next day or
two?  If not, I'll file an issue for it.

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org