develooper Front page | perl.perl5.porters | Postings from November 2003

PERL_VERSION, SUBVERSION, PATCHLEVEL

Thread Next
From:
Marcus Holland-Moritz
Date:
November 1, 2003 07:06
Subject:
PERL_VERSION, SUBVERSION, PATCHLEVEL
Message ID:
011a01c3a085$ed85f6a0$e200a8c0@R2D2
I'm wondering if a certain piece of code I can find
replicated in Devel::PPPort, Digest::MD5, List::Util,
MIME::Base64 and Storable makes sense. (Introduced
by changes #18709, #18826)

  #if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
  #  include <could_not_find_Perl_patchlevel.h>
  #endif

Don't SUBVERSION and PATCHLEVEL have to be exchanged?

This is what different perl's define:

  SUBVERSION --------------------------.
  PATCHLEVEL ---------------------.    |
  PERL_SUBVERSION -----------.    |    |
  PERL_VERSION ---------.    |    |    |
  PERL_REVISION ---.    |    |    |    |
                   |    |    |    |    |

  perl5.000       n/a  n/a  n/a   0   n/a
  perl5.001       n/a  n/a  n/a   1   n/a

  perl5.002       n/a  n/a  n/a   2    0
  perl5.003       n/a  n/a  n/a   3    0
  perl5.004       n/a  n/a  n/a   4    0
  perl5.004_05    n/a  n/a  n/a   4    5
  perl5.005       n/a  n/a  n/a   5    0
  perl5.005_03    n/a  n/a  n/a   5    3

  perl-5.6.0       5    6    0   n/a  n/a
  perl-5.6.1       5    6    1   n/a  n/a
  perl-5.8.0       5    8    0   n/a  n/a
  perl-5.8.1       5    8    1   n/a  n/a

So, assuming a perl5 binary, it seems that PATCHLEVEL
is always defined. So defined(PATCHLEVEL) is more or
less useless. Also, checking for (SUBVERSION > 0) will
allow compiling under perl5.005_03 and perl5.004_05,
but not under perl5.005, perl5.004 and perl5.003.

Devel::PPPort states:

 * This version of ppport.h is designed to support operation with Perl
 * installations back to 5.004, and has been tested up to 5.8.1.
                 ^^^^^^^^^^^^^

I doubt that because of the above. To me, it would
make a lot more sense to have:

  #if !(defined(PERL_VERSION) || (PATCHLEVEL > 0 && defined(SUBVERSION)))
  #  include <could_not_find_Perl_patchlevel.h>
  #endif

This would only exclude perl5.000 and perl5.001 from
compiling said extensions (or any extensions that use
ppport.h).

Is anyone sharing my objections or can anyone explain
why it's currently implemented like this?

-- Marcus


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About