pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / development / perl-modules / sdl-modern-perl.patch
blobc97eeb034486e4a68c0638c6c9a7705a86912cef
1 From d734d03862d7dcc776bd2fa3ba662cdd5879b32e Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3 Date: Wed, 12 Jul 2023 17:55:27 +0200
4 Subject: [PATCH] Adapt to perl 5.37.1
6 Perl 5.37.1 removed a deprecated sv_nv() macro and SDL fails to build
7 with Perl 5.38.0:
9 lib/SDLx/Controller/Interface.xs:60:26: error: implicit declaration of function 'sv_nv'
10 60 | out->dv_x = sv_nv(temp);
11 | ^~~~~
13 Users are advised to use SvNVx() macro instead. SvNVx() seems to have been
14 available all the time (it predates a commit from 1993-10-07).
16 This patch does that.
18 https://github.com/PerlGameDev/SDL/issues/303
19 ---
20 src/SDLx/Controller/Interface.xs | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
23 diff --git a/src/SDLx/Controller/Interface.xs b/src/SDLx/Controller/Interface.xs
24 index 3dc202b7..d326c885 100644
25 --- a/src/SDLx/Controller/Interface.xs
26 +++ b/src/SDLx/Controller/Interface.xs
27 @@ -57,15 +57,15 @@ void evaluate(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial, fl
29 SV *temp;
30 temp = av_pop(accel);
31 - out->dv_x = sv_nv(temp);
32 + out->dv_x = SvNVx(temp);
33 SvREFCNT_dec(temp);
35 temp = av_pop(accel);
36 - out->dv_y = sv_nv(temp);
37 + out->dv_y = SvNVx(temp);
38 SvREFCNT_dec(temp);
40 temp = av_pop(accel);
41 - out->dang_v = sv_nv(temp);
42 + out->dang_v = SvNVx(temp);
43 SvREFCNT_dec(temp);
45 SvREFCNT_dec((SV *)accel);
46 @@ -90,15 +90,15 @@ void evaluate_dt(SDLx_Interface *obj, SDLx_Derivative *out, SDLx_State *initial,
48 SV *temp;
49 temp = av_pop(accel);
50 - out->dv_x = sv_nv(temp);
51 + out->dv_x = SvNVx(temp);
52 SvREFCNT_dec(temp);
54 temp = av_pop(accel);
55 - out->dv_y = sv_nv(temp);
56 + out->dv_y = SvNVx(temp);
57 SvREFCNT_dec(temp);
59 temp = av_pop(accel);
60 - out->dang_v = sv_nv(temp);
61 + out->dang_v = SvNVx(temp);
62 SvREFCNT_dec(temp);
64 SvREFCNT_dec((SV *)accel);