Skip to content

Commit

Permalink
Adapt to perl 5.37.1
Browse files Browse the repository at this point in the history
Perl 5.37.1 removed a deprecated sv_nv() macro and SDL fails to build
with Perl 5.38.0:

lib/SDLx/Controller/Interface.xs:60:26: error: implicit declaration of function 'sv_nv'
   60 |         out->dv_x      = sv_nv(temp);
      |                          ^~~~~

Users are advised to use SvNVx() macro instead. SvNVx() seems to have been
available all the time (it predates a commit from 1993-10-07).

This patch does that.

PerlGameDev#303
  • Loading branch information
ppisar committed Jul 12, 2023
1 parent 3a84fb7 commit d734d03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/SDLx/Controller/Interface.xs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ void evaluate(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial, fl

SV *temp;
temp = av_pop(accel);
out->dv_x = sv_nv(temp);
out->dv_x = SvNVx(temp);
SvREFCNT_dec(temp);

temp = av_pop(accel);
out->dv_y = sv_nv(temp);
out->dv_y = SvNVx(temp);
SvREFCNT_dec(temp);

temp = av_pop(accel);
out->dang_v = sv_nv(temp);
out->dang_v = SvNVx(temp);
SvREFCNT_dec(temp);

SvREFCNT_dec((SV *)accel);
Expand All @@ -90,15 +90,15 @@ void evaluate_dt(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial,

SV *temp;
temp = av_pop(accel);
out->dv_x = sv_nv(temp);
out->dv_x = SvNVx(temp);
SvREFCNT_dec(temp);

temp = av_pop(accel);
out->dv_y = sv_nv(temp);
out->dv_y = SvNVx(temp);
SvREFCNT_dec(temp);

temp = av_pop(accel);
out->dang_v = sv_nv(temp);
out->dang_v = SvNVx(temp);
SvREFCNT_dec(temp);

SvREFCNT_dec((SV *)accel);
Expand Down

0 comments on commit d734d03

Please sign in to comment.