Justin Erenkrantz wrote:
--On Thursday, February 27, 2003 12:11 PM +1100 Stas Bekman <[EMAIL PROTECTED]> wrote:

Assuming that my patch to handle the segfault in apr_uri_unparse
goes in before the next -gold release, how am I supposed to handle
the older apr (since modperl has to support older apr as well).
Currently it seems that I have to do the following:

# if APR_MINOR_VERSION == 9 &&
(APR_PATCH_VERSION < 2 || APR_PATCH_VERSION == 2 &&
APR_IS_DEV_VERSION)      /* apr < 0.9.3 segfaults if hostname is
set, but scheme is not */      if (uptr->hostname && !uptr->scheme)
{
         uptr->scheme = "http";
     }
# endif

that's a way too messed up.


So say you. That's the price you pay for backwards compatbility. If *you* want to be backwards-compatible, *you* have to do this check. If you don't like the preprocessor, you can code it up via apr_version and do it at run-time.

About the only thing we could do to moderately help out is to add:
APR_VERSION_AT_LEAST(major, minor, patch, final). That would sort of hide it a bit. But, that's not going to help you since you'd have to compile against an APR that doesn't have it. =)


I don't see why we have to go to 0.9.3 because you don't want to do the check properly. The point is that there is a way of determining if you are at 0.9.2-dev versus 0.9.2. -- justin

Bill's proposal was to move to a different (better?) versioning scheme, so I could just say:


#if APR_MINOR_VERSION == 9 && APR_PATCH_VERSION < 3

and this will work for all older apr's as well. I've followed up on Bill's proposal showing an example of why it'd be a good change from the user's point of view.

If the proposal is not accepted, I will use whatever API is available.


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to