Skip to content

Commit

Permalink
HACKERS: Update based on new version compare macros
Browse files Browse the repository at this point in the history
Note the existence of these for people writing code.
  • Loading branch information
khwilliamson committed Jul 9, 2020
1 parent f1aa4d2 commit a15c019
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions HACKERS
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,24 @@ Perl public API.

=item Version numbers

Version checking can be tricky to get correct (besides being buggy in some perl
versions).
C<ivers()> is used in the C<=tests> section to overcome this, and constructs
Version checking used to be tricky to get correct (besides being buggy in some
perl versions).
C<ivers()> is used in the C<=tests> section to overcome this. and constructs
like the following in the C language sections.

#if { VERSION < 5.9.3 }
#if PERL_VERSION_EQ(5,9,3)
#if PERL_VERSION_NE(5,9,3)
#if PERL_VERSION_LT(5,9,3)
#if PERL_VERSION_GT(5,9,3)
#if PERL_VERSION_LE(5,9,3)
#if PERL_VERSION_GE(5,9,3)

instead of
An alternative way of saying things like these is

#if ((PERL_VERSION < 9) \
|| (PERL_VERSION == 9 && PERL_SUBVERSION < 3))
#if { VERSION < 5.9.3 }

The version number can be either of the new form C<5.x.x> or the older
form C<5.00x_yy>. Both are translated into the correct preprocessor
In this form, the version number can be either of the new form C<5.x.x> or the
older form C<5.00x_yy>. Both are translated into the correct preprocessor
statements. It is also possible to combine this with other statements:

#if { VERSION >= 5.004 } && !defined(sv_vcatpvf)
Expand Down

0 comments on commit a15c019

Please sign in to comment.